-
Notifications
You must be signed in to change notification settings - Fork 308
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
Export an Error type that can be caught and handled #719
Comments
Yes, +1 to this. I am also noticing that the error description is not simple to derive either. I am looking to extract the following to return in the response to several requests (password grant, database signup, request change password email, and update auth0 user):
I have looked through the code of both this library and rest-facade in these locations:
Status Code ✅The Message ❓I am currently using the What is the best way to extract a human-readable error message? A few examples with inconsistencies: Password grant with wrong passwordI am seeing the following:
Database signup user existsI am seeing the following:
|
Thanks for raising this @Pipeliner I don't see a short term solution to this, but I'll leave this open as an enhancement for when we consider the next iteration of this SDK |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇♂️ |
I'm pleased to report that the Beta of v4 is now available. This has been rewritten in TypeScript and has full type coverage of Auth0's Management and Authentication APIs (including error types) Closing this thread in favour of #859 |
Describe the problem you'd like to have solved
On errors, Auth0 throws Error objects that can't be easily differentiated from other kind of errors.
e.g.
PasswordlessAuthenticator.signIn()
can throw a lot of different errors depending on problems with the token / user being blocked / etc.I can't easily differentiate these errors from other errors that might happen in my code or other libraries.
Describe the ideal solution
There is a base class for Auth0 errors (and maybe subclasses for specific errors)
Alternatives and current work-arounds
I can try to catch
SanitizedError
s which happen to be the errors which Auth0 usually throw. However, this is not documented anywhere and is there not guaranteed to be the case.Additional information, if any
--
The text was updated successfully, but these errors were encountered: