paragonie / paseto

Platform-Agnostic Security Tokens
https://paseto.io
Other
3.24k stars 108 forks source link

Exception codes #116

Closed razvanioan closed 3 years ago

razvanioan commented 4 years ago

Is there a way to implement exception codes, at least for Parser ?

For instance Parser can throw a number of Exception types (which we can distinguish quite well) but we don't want to directly show the default error messages to the user, and for sure not all those error types.

For instance, I would like to show a message to the user ONLY if it didn't pass the NotExpired rule.

I get a RuleViolation exception with some info in the message that I need to parse and reinterpret to the user.

A fixed custom code would have been more precise.

paragonie-security commented 3 years ago

This is doable.

paragonie-security commented 3 years ago

We'll do this after we're done with the other work we have in the pipeline.