geraintluff / uri-templates

JavaScript utility for RFC 6570: URI Templates
138 stars 21 forks source link

Catch failed percent-decode #13

Open geraintluff opened 9 years ago

geraintluff commented 9 years ago

URLs such as some%thing -> {url} will throw because %th is not a valid character. We should catch these and treat them as failures.

gr0uch commented 9 years ago

I think that this is expected behavior and nothing should be done by this library about it: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError.

geraintluff commented 8 years ago

True - however, in situations where you're pattern matching (e.g. using this module in a routing table), throwing exceptions is might be impolite.