-
Notifications
You must be signed in to change notification settings - Fork 231
Open
Labels
feature requestA feature has been asked for or suggested by the communityA feature has been asked for or suggested by the community
Description
Checklist
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved
I hope I've searched enough and I'm not requesting something that already exists ...
The SDK currently provides a good error handling structure:
when calling methods like authorize, clearSession, etc., the result can be checked via isError and error.
However, the error object only exposes a generic message, and developers have to parse the returned string to determine the actual error type (e.g. a0.session.user_cancelled, a0.network_error, etc.).
This makes error handling brittle and platform-dependent.
Describe the ideal solution
It would be very helpful if the SDK exposed typed error definitions or an exported Auth0Error enum/interface, for example:
import { Auth0ErrorType } from 'react-native-auth0';
try {
await auth0.webAuth.clearSession();
} catch (e) {
if (e.type === Auth0ErrorType.UserCancelled) {
// handle user cancel cleanly
}
}
Alternatives and current workarounds
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
feature requestA feature has been asked for or suggested by the communityA feature has been asked for or suggested by the community