-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
docs(tutorials/jokes): use enabled future flags #6050
docs(tutorials/jokes): use enabled future flags #6050
Conversation
|
@@ -4113,68 +4141,66 @@ Sometimes users do things we can anticipate. I'm not talking about validation ne | |||
|
|||
It might help to think of the unexpected errors as 500-level errors ([server errors][server-errors]) and the expected errors as 400-level errors ([client errors][client-errors]). | |||
|
|||
For client error responses, Remix offers something similar to Error Boundaries. It's called [`Catch Boundaries`][catch-boundaries] and it works almost exactly the same. In this case, when your server code detects a problem, it'll throw a [`Response`][response] object. Remix then catches that thrown response and renders your `CatchBoundary`. Just like the `useLoaderData` hook to get data from the `loader` and the `useActionData` hook to get data from the `action`, the `CatchBoundary` gets its data from the `useCatch` hook. This will return the `Response` that was thrown. | |||
To check for client error responses, Remix offers the [`isRouteErrorResponse`][is-route-error-response] helper function. In the case that your server code detects a problem, it'll throw a [`Response`][response] object. Remix then catches that thrown `Response` and renders your `ErrorBoundary`. Since you can throw whatever you want, the `isRouteErrorResponse` helper function is a way to check if the thrown instance is a `Response` object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link for is-route-error-response
seems to point in the wrong path? 😅
https://remix.run/docs/en/main/utils/is-route-error-response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once #6064 is merged, this will be fixed.
Thanks for noticing us! 🙏
No description provided.