You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to detect if an error response was thrown in an action (POST, ...) or loader (GET).
The only way to communicate this explicitly I've found is returning the context information via response body, then access it via error.data in the error boundary. This is both unreliable and also requires you to shape the Response body uniform and manually provide this context in each loader/exception the error is thrown.
Also in error boundary you can't get this context via any of the hooks like useNavigation or useNavigationType.
The point why I need is that I want the user to provide the ability to recover, by either returning to previous page, if it was a navigation, or if it was not a navigation, just reload the page to clear the error boundary.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to detect if an error response was thrown in an action (POST, ...) or loader (GET).
The only way to communicate this explicitly I've found is returning the context information via response body, then access it via error.data in the error boundary. This is both unreliable and also requires you to shape the Response body uniform and manually provide this context in each loader/exception the error is thrown.
Also in error boundary you can't get this context via any of the hooks like useNavigation or useNavigationType.
The point why I need is that I want the user to provide the ability to recover, by either returning to previous page, if it was a navigation, or if it was not a navigation, just reload the page to clear the error boundary.
Beta Was this translation helpful? Give feedback.
All reactions