Handle errors
Classify before rendering
- Validation and domain rejection are expected outcomes near the action.
- HTTP timeout, abort, offline, and non-success status belong to the request owner.
- Route resolve failure belongs to transition policy.
- Unexpected exceptions belong to
$exceptionHandlerand diagnostics.
Do not convert every rejection to [], null, or false. That destroys
information and commonly renders an empty success state after a real failure.
Wrap low-level errors with the operation name while retaining the original cause. The UI should receive a stable category and recovery action, not a stack trace or server payload. Logs may include release, route, operation, and correlation identifiers but must exclude credentials and private data.
A repository may retry a safe idempotent read. A component should own the retry button. Global interceptors should refresh credentials or normalize protocol behavior, not retry every request indiscriminately.
Unexpected exceptions should reach the
$exceptionHandler reference. Test that
expected failures remain recoverable and unexpected exceptions are reported.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.