Next.js · Senior · Question 31 of 75
How does unstable_rethrow help with error handling?
- ✓Correct answer: It rethrows Next.js internal errors out of
catch - 2It retries a failed request a given number of times with a delay
- 3It sends the error to the connected monitoring system
Explanation
Next.js uses exceptions for control flow: redirect, notFound, dynamic rendering signals. A broad try/catch swallows them and breaks behavior. unstable_rethrow(err) at the start of catch rethrows such errors and leaves you only the "real" ones.