Best way to catch/handle errors during streaming
Hello, I am getting the error
snippet/example of what I am doing:
However, in this case it is throwing from a 404. I want to catch this and redirect. Given I am in a server component, I tried to try/catch with a redirect to no avail. It is just showing my error boundary.
What is the best way to handle this error? Or perhaps more specifically, how can I catch this error and redirect/do some other action?
Thanks!
A query that was dehydrated as pending ended up rejecting. but I am unable to try/catch it and unsure of the best way to handle these errors. snippet/example of what I am doing:
However, in this case it is throwing from a 404. I want to catch this and redirect. Given I am in a server component, I tried to try/catch with a redirect to no avail. It is just showing my error boundary.
What is the best way to handle this error? Or perhaps more specifically, how can I catch this error and redirect/do some other action?
Thanks!