Replies: 2 comments 12 replies
-
I had this problem too, but switching from |
Beta Was this translation helpful? Give feedback.
4 replies
-
so i guess, only way to handle redirects inside try catch is: try {
// do something
} catch(error) {
if(error.hasOwnProperty("location")) throw error;
// otherwise handle actual error :disappointed:
} |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
for a scenario, using a try catch block where all exceptions are caught so that user is redirect back to a certain page,
throw redirect(301, "/path")
is creating issue, since this is also treated as an error.current workaround is checking if
error instanceof Response
, but this is not a good method, instead of throwing redirect, returning redirect would perfectly solve the problem.Haven't anyone felt this problem?? Or there's some better and I'm unknown about on redirects 😢
Beta Was this translation helpful? Give feedback.
All reactions