GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [Flight] Improve error message when it's not a real Error object by sebmarkbage · Pull Request #28327 · react/react Conversation
Contributor
Also deals with symbols. Alternative to #28312. We currently always normalize rejections or thrown values into 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 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.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
Comparing: dc31781...fee168e Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
5a33d8e to
6b66058
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should we do the same for encodeErrorForBoundary in Fizz?
Also, seems like in Prod the error boundary isn't catching the error? Don't understand how that could be
Sorry, something went wrong.
There was an error while loading. Please reload this page.
6b66058 to
4c64861
Compare
Looks like we look for the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Also deals with symbols.
4c64861 to
fee168e
Compare
|
It sucks that DevTools doesn't print the However this whole DEV-only thing is weird. We probably shouldn't even expose it to programmatic code and only DevTools can actually see the hidden internals just like |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
) 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 [a7144f2](a7144f2)
| } else if (typeof error === 'object' && error !== null) { | ||
| message = 'Error: ' + describeObjectForErrorMessage(error); | ||
| } else { | ||
| message = 'Error: ' + (error: any); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This prefix actually doesn't really make sense because this prefix already comes as part of the .stack property with the constructor's name.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Same as #28327 but for Fizz. One thing that's weird about this recoverable error is that we don't send the regular stack for it, just the component stack it seems. This is missing some potential information and if we move toward integrated since stacks it would be one thing.
Same as #28327 but for Fizz. One thing that's weird about this recoverable error is that we don't send the regular stack for it, just the component stack it seems. This is missing some potential information and if we move toward integrated since stacks it would be one thing. DiffTrain build for [2e470a7](2e470a7)
### React upstream changes - react/react#28333 - react/react#28334 - react/react#28378 - react/react#28377 - react/react#28376 - react/react#28338 - react/react#28331 - react/react#28336 - react/react#28320 - react/react#28317 - react/react#28375 - react/react#28367 - react/react#28380 - react/react#28368 - react/react#28343 - react/react#28355 - react/react#28374 - react/react#28362 - react/react#28344 - react/react#28339 - react/react#28353 - react/react#28346 - react/react#25790 - react/react#28352 - react/react#28326 - react/react#27688 - react/react#28329 - react/react#28332 - react/react#28340 - react/react#28327 - react/react#28325 - react/react#28324 - react/react#28309 - react/react#28310 - react/react#28307 - react/react#28306 - react/react#28315 - react/react#28318 - react/react#28226 - react/react#28308 - react/react#27563 - react/react#28297 - react/react#28286 - react/react#28284 - react/react#28275 - react/react#28145 - react/react#28301 - react/react#28224 - react/react#28152 - react/react#28296 - react/react#28294 - react/react#28279 - react/react#28273 - react/react#28269 - react/react#28376 - react/react#28338 - react/react#28331 - react/react#28336 - react/react#28320 - react/react#28317 - react/react#28375 - react/react#28367 - react/react#28380 - react/react#28368 - react/react#28343 - react/react#28355 - react/react#28374 - react/react#28362 - react/react#28344 - react/react#28339 - react/react#28353 - react/react#28346 - react/react#25790 - react/react#28352 - react/react#28326 - react/react#27688 - react/react#28329 - react/react#28332 - react/react#28340 - react/react#28327 - react/react#28325 - react/react#28324 - react/react#28309 - react/react#28310 - react/react#28307 - react/react#28306 - react/react#28315 - react/react#28318 - react/react#28226 - react/react#28308 - react/react#27563 - react/react#28297 - react/react#28286 - react/react#28284 - react/react#28275 - react/react#28145 - react/react#28301 - react/react#28224 - react/react#28152 - react/react#28296 - react/react#28294 - react/react#28279 - react/react#28273 - react/react#28269 Closes NEXT-2542 Disable ppr test for strict mode for now, @acdlite will check it and we'll sync again
…ct#28327) Also deals with symbols. Alternative to react#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.
Same as react#28327 but for Fizz. One thing that's weird about this recoverable error is that we don't send the regular stack for it, just the component stack it seems. This is missing some potential information and if we move toward integrated since stacks it would be one thing.
) 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.
Same as #28327 but for Fizz. One thing that's weird about this recoverable error is that we don't send the regular stack for it, just the component stack it seems. This is missing some potential information and if we move toward integrated since stacks it would be one thing. DiffTrain build for commit 2e470a7.
…ct#28327) Also deals with symbols. Alternative to react#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.
Same as react#28327 but for Fizz. One thing that's weird about this recoverable error is that we don't send the regular stack for it, just the component stack it seems. This is missing some potential information and if we move toward integrated since stacks it would be one thing.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.