Skip to content

Commit cf544ed

Browse files
committed
[Flight] Improve error message when it's not a real Error object (#28327)
Also deals with symbols. Alternative to #28312. We currently always normalize rejections or thrown values into `Error` objects. Partly because in prod it'll be an error object and you shouldn't fork behavior on knowing the value outside a digest. We might want to even make the message always opaque to avoid being tempted and then discover in prod that it doesn't work. However, we do include the message in DEV. If this is a non-Error object we don't know what the properties mean. Ofc, we don't want to include too much information in the rendered string, so we use the general `describeObjectForErrorMessage` helper. Unfortunately it's pretty conservative about emitting values so it's likely to exclude any embedded string atm. Could potentially expand it a bit. We could in theory try to serialize as much as possible and re-throw the actual object to allow for inspection to be expanded inside devtools which is what I plan on for consoles, but since we're normalizing to an Error this is in conflict with that approach. DiffTrain build for commit a7144f2.
1 parent 01f540a commit cf544ed

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25922,7 +25922,7 @@ if (__DEV__) {
2592225922
return root;
2592325923
}
2592425924

25925-
var ReactVersion = "18.3.0-canary-adadb8169-20240214";
25925+
var ReactVersion = "18.3.0-canary-a7144f297-20240214";
2592625926

2592725927
// Might add PROFILE later.
2592825928

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9169,7 +9169,7 @@ var devToolsConfig$jscomp$inline_1024 = {
91699169
throw Error("TestRenderer does not support findFiberByHostInstance()");
91709170
},
91719171
bundleType: 0,
9172-
version: "18.3.0-canary-adadb8169-20240214",
9172+
version: "18.3.0-canary-a7144f297-20240214",
91739173
rendererPackageName: "react-test-renderer"
91749174
};
91759175
var internals$jscomp$inline_1205 = {
@@ -9200,7 +9200,7 @@ var internals$jscomp$inline_1205 = {
92009200
scheduleRoot: null,
92019201
setRefreshHandler: null,
92029202
getCurrentFiber: null,
9203-
reconcilerVersion: "18.3.0-canary-adadb8169-20240214"
9203+
reconcilerVersion: "18.3.0-canary-a7144f297-20240214"
92049204
};
92059205
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
92069206
var hook$jscomp$inline_1206 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9597,7 +9597,7 @@ var devToolsConfig$jscomp$inline_1066 = {
95979597
throw Error("TestRenderer does not support findFiberByHostInstance()");
95989598
},
95999599
bundleType: 0,
9600-
version: "18.3.0-canary-adadb8169-20240214",
9600+
version: "18.3.0-canary-a7144f297-20240214",
96019601
rendererPackageName: "react-test-renderer"
96029602
};
96039603
var internals$jscomp$inline_1246 = {
@@ -9628,7 +9628,7 @@ var internals$jscomp$inline_1246 = {
96289628
scheduleRoot: null,
96299629
setRefreshHandler: null,
96309630
getCurrentFiber: null,
9631-
reconcilerVersion: "18.3.0-canary-adadb8169-20240214"
9631+
reconcilerVersion: "18.3.0-canary-a7144f297-20240214"
96329632
};
96339633
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
96349634
var hook$jscomp$inline_1247 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-canary-adadb8169-20240214";
27+
var ReactVersion = "18.3.0-canary-a7144f297-20240214";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,4 +590,4 @@ exports.useSyncExternalStore = function (
590590
exports.useTransition = function () {
591591
return ReactCurrentDispatcher.current.useTransition();
592592
};
593-
exports.version = "18.3.0-canary-adadb8169-20240214";
593+
exports.version = "18.3.0-canary-a7144f297-20240214";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ exports.useSyncExternalStore = function (
586586
exports.useTransition = function () {
587587
return ReactCurrentDispatcher.current.useTransition();
588588
};
589-
exports.version = "18.3.0-canary-adadb8169-20240214";
589+
exports.version = "18.3.0-canary-a7144f297-20240214";
590590
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
591591
"function" ===
592592
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
adadb8169e781ff645c61aa558dc901b1c2c97f4
1+
a7144f297c1c6fe457ca30ce6a211ab59feac11e

0 commit comments

Comments
 (0)