-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handling invalid token without raising Exception #22
Comments
@slashmili how did you manage the Argument error? I made this, what do you think?
|
More or less, if you look at the way that Elixir/Erlang handles "valid" errors is more like this :
So what I use is like this:
What I would like to see from this library is to return like this:
|
Version 1.8.0 of jose essentially just captures the thrown exceptions and returns then as an I would like to refactor the project to return things similar to what @slashmili suggested, but the amount of refactoring required might be better suited for the next major version of the project. |
What do you think of returning
false
when the token is invalid instead of raising ArgumentError?I'm suggesting that because feels more natural and also make it much easier to use with pipes in Elixir.
The text was updated successfully, but these errors were encountered: