pallets-eco / flask-jwt

JWT (JSON Web Tokens) for Flask applications
MIT License
564 stars 177 forks source link

cannot import exception types #82

Open jrhite opened 8 years ago

jrhite commented 8 years ago

I'd like to be able to catch ExpiredSignatureError, DecodeError and other specific exceptions and do something meaningful with them, but they aren't exposed for import. I can only import JWTError, but I see more specific exceptions 'escaping' (eg: DecodeError).

Further on an expired signature for example, internal to flask-jwt a ExpiredSignatureError is generated, but is later exposed externally as a JWTError with only a description that the token has expired which makes exception handling awkward as I have to inspect the text of the description rather than just catching on the exception type itself.

Can these errors be exposed externally so they can be imported and used externally?

Thanks!