mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fizz: Prevent UnhandledPromiseRejection if shell errors (#24043)
This commit is contained in:
@@ -67,6 +67,10 @@ function renderToReadableStream(
|
||||
resolve(stream);
|
||||
}
|
||||
function onShellError(error: mixed) {
|
||||
// If the shell errors the caller of `renderToReadableStream` won't have access to `allReady`.
|
||||
// However, `allReady` will be rejected by `onFatalError` as well.
|
||||
// So we need to catch the duplicate, uncatchable fatal error in `allReady` to prevent a `UnhandledPromiseRejection`.
|
||||
allReady.catch(() => {});
|
||||
reject(error);
|
||||
}
|
||||
const request = createRequest(
|
||||
|
||||
Reference in New Issue
Block a user