next.js
dbab205b - ensure server action errors notify rejection handlers (#61588)

Commit
2 years ago
ensure server action errors notify rejection handlers (#61588) ### What When attaching a rejection listener to a server action promise, in the case of network errors, the rejection handler would be skipped and it'd throw an error that crashes the application. ### Why When we refactored these reducers to no longer suspend, it caused the rejection handling logic we have to no longer make sense. In this case we're working with a native promise that won't have a `status` property, so we'd re-throw the error and not call `reject`. ### How This removes the special status handling logic and makes the rejection handler always call `reject` with the error. This will either be handled by user code or let the error bubble to an error boundary. I also cleaned up some mutable code that is no longer needed now that these reducers aren't replayed. Closes NEXT-1715 Closes NEXT-2323 Fixes #58638
Author
Committer
Parents
Loading