Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server-renderer): catch errors from all promises in unrollBuffer() #10639

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MichaelRoosz
Copy link

@MichaelRoosz MichaelRoosz commented Apr 2, 2024

In server-renderer, a SSRBuffer may contain multiple promises.

Currently unrollBuffer() throws immediately when the first promise is rejected / throws an error

In this case, the remaining promises will be ignored.

If any of these ignored promises also reject / throw an error, nodejs will throw an unhandledRejection event and shutdown / crash by default.

This pr tries to improve the situation by collecting the errors from all promises and, if more than one error has been thrown, throw a MultipleErrors error, which contains these errors.

The same issue has been discussed here: #7660, but instead of ignoring all errors, this pr keeps the existing behaviour for 0 or 1 errors, and returns all errors if multiple happened.

@sodatea sodatea added scope: ssr version: minor 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. scope: ssr version: minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants