Skip to content

Conversation

@castrinho18
Copy link
Contributor

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

At this moment error handling is managed manually with a try/catch on each API request, which is a problem if we want to manage behaviours in the same way for any error that is been thrown.

This PR unifies error management in a useErrorHandler hook so all errors in API requests should be managed by this hook.

The PR introduces the SilentError class too, for cases where we need to stop the execution but do nothing and log a warning, like when a onBefore function implemented by the user returns false.

References

Testing

Describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

Please include any manual steps for testing end-to-end or functionality not covered by unit/integration tests.

Also include details of the environment this PR was developed in (language/platform/browser version).

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
    Does not change public interfaces.
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@castrinho18 castrinho18 self-assigned this Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants