paragonie / paseto

Platform-Agnostic Security Tokens

Home Page:https://paseto.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception codes

razvanioan opened this issue · comments

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.

This is doable.

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