Skip to content

Commit 3b201dd

Browse files
committed
Fix error handling when the Flight client itself errors
1 parent 9ff738f commit 3b201dd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/react-server-dom-webpack/src/ReactFlightDOMClient.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,18 @@ function startReadingFromStream(
3535
}
3636
const buffer: Uint8Array = (value: any);
3737
processBinaryChunk(response, buffer);
38-
return reader.read().then(progress, error);
38+
return reader
39+
.read()
40+
.then(progress)
41+
.catch(error);
3942
}
4043
function error(e) {
4144
reportGlobalError(response, e);
4245
}
43-
reader.read().then(progress, error);
46+
reader
47+
.read()
48+
.then(progress)
49+
.catch(error);
4450
}
4551

4652
function createFromReadableStream(

0 commit comments

Comments
 (0)