MCPcopy
hub / github.com/facebook/react / fatalError

Function fatalError

packages/react-server/src/ReactFizzServer.js:1245–1270  ·  view source on GitHub ↗
(
  request: Request,
  error: mixed,
  errorInfo: ThrownInfo,
  debugTask: null | ConsoleTask,
)

Source from the content-addressed store, hash-verified

1243}
1244
1245function fatalError(
1246 request: Request,
1247 error: mixed,
1248 errorInfo: ThrownInfo,
1249 debugTask: null | ConsoleTask,
1250): void {
1251 // This is called outside error handling code such as if the root errors outside
1252 // a suspense boundary or if the root suspense boundary's fallback errors.
1253 // It's also called if React itself or its host configs errors.
1254 const onShellError = request.onShellError;
1255 const onFatalError = request.onFatalError;
1256 if (__DEV__ && debugTask) {
1257 debugTask.run(onShellError.bind(null, error));
1258 debugTask.run(onFatalError.bind(null, error));
1259 } else {
1260 onShellError(error);
1261 onFatalError(error);
1262 }
1263 if (request.destination !== null) {
1264 request.status = CLOSED;
1265 closeWithError(request.destination, error);
1266 } else {
1267 request.status = CLOSING;
1268 request.fatalError = error;
1269 }
1270}
1271
1272function renderSuspenseBoundary(
1273 request: Request,

Callers 5

erroredTaskFunction · 0.70
abortTaskFunction · 0.70
performWorkFunction · 0.70
startFlowingFunction · 0.70
abortFunction · 0.70

Calls 3

closeWithErrorFunction · 0.90
runMethod · 0.80
onShellErrorFunction · 0.50

Tested by

no test coverage detected