Skip to content

Commit

Permalink
Fix error handling when the Flight client itself errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Aug 27, 2022
1 parent 9ff738f commit 3b201dd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/react-server-dom-webpack/src/ReactFlightDOMClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ function startReadingFromStream(
}
const buffer: Uint8Array = (value: any);
processBinaryChunk(response, buffer);
return reader.read().then(progress, error);
return reader
.read()
.then(progress)
.catch(error);
}
function error(e) {
reportGlobalError(response, e);
}
reader.read().then(progress, error);
reader
.read()
.then(progress)
.catch(error);
}

function createFromReadableStream(
Expand Down

0 comments on commit 3b201dd

Please sign in to comment.