GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Log all errors to console.error by default (#21130) · react/react@0853aab

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • react-client/src/__tests__
      • ReactFlight-test.js
    • react-server/src
      • ReactFizzServer.js
      • ReactFlightServer.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-client/src/__tests__/ReactFlight-test.js‎

Copy file name to clipboardExpand all lines: packages/react-client/src/__tests__/ReactFlight-test.js
+14-5Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,15 @@ describe('ReactFlight', () => {
156156
return <div ref={ref} />;
157157
}
158158

159-
const event = ReactNoopFlightServer.render(<EventHandlerProp />);
160-
const fn = ReactNoopFlightServer.render(<FunctionProp />);
161-
const symbol = ReactNoopFlightServer.render(<SymbolProp />);
162-
const refs = ReactNoopFlightServer.render(<RefProp />);
159+
const options = {
160+
onError() {
161+
// ignore
162+
},
163+
};
164+
const event = ReactNoopFlightServer.render(<EventHandlerProp />, options);
165+
const fn = ReactNoopFlightServer.render(<FunctionProp />, options);
166+
const symbol = ReactNoopFlightServer.render(<SymbolProp />, options);
167+
const refs = ReactNoopFlightServer.render(<RefProp />, options);
163168

164169
function Client({transport}) {
165170
return ReactNoopFlightClient.read(transport);
@@ -213,7 +218,11 @@ describe('ReactFlight', () => {
213218
);
214219
}
215220

216-
const data = ReactNoopFlightServer.render(<Server />);
221+
const data = ReactNoopFlightServer.render(<Server />, {
222+
onError(x) {
223+
// ignore
224+
},
225+
});
217226

218227
function Client({transport}) {
219228
return ReactNoopFlightClient.read(transport);
Collapse file

‎packages/react-server/src/ReactFizzServer.js‎

Copy file name to clipboardExpand all lines: packages/react-server/src/ReactFizzServer.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,17 @@ type Request = {
142142
// 500 * 1024 / 8 * .8 * 0.5 / 2
143143
const DEFAULT_PROGRESSIVE_CHUNK_SIZE = 12800;
144144

145+
function defaultErrorHandler(error: mixed) {
146+
console['error'](error); // Don't transform to our wrapper
147+
}
148+
145149
export function createRequest(
146150
children: ReactNodeList,
147151
destination: Destination,
148152
responseState: ResponseState,
149153
rootContext: FormatContext,
150154
progressiveChunkSize: number = DEFAULT_PROGRESSIVE_CHUNK_SIZE,
151-
onError: (error: mixed) => void = noop,
155+
onError: (error: mixed) => void = defaultErrorHandler,
152156
onCompleteAll: () => void = noop,
153157
onReadyToStream: () => void = noop,
154158
): Request {
Collapse file

‎packages/react-server/src/ReactFlightServer.js‎

Copy file name to clipboardExpand all lines: packages/react-server/src/ReactFlightServer.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ export type Request = {
9191

9292
const ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
9393

94-
function defaultErrorHandler() {}
94+
function defaultErrorHandler(error: mixed) {
95+
console['error'](error); // Don't transform to our wrapper
96+
}
9597

9698
export function createRequest(
9799
model: ReactModel,

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.