Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[React DevTools] Improve DevTools UI when Inspecting a user Component that Throws an Error #24248

Merged
merged 15 commits into from
May 6, 2022
Prev Previous commit
Next Next commit
fix lint & better comment
mondaychen committed May 5, 2022

Verified

This commit was signed with the committer’s verified signature.
ob-stripe Olivier Bellone
commit 05505f88a7a784e7d9ace4ca821ab4069924ad9d
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
*/

import LRU from 'lru-cache';
import {UserHookError} from 'react-debug-tools';
import {
convertInspectedElementBackendToFrontend,
hydrateHelper,
@@ -97,15 +96,15 @@ export function inspectElement({

case 'user-error': {
const {message, stack} = (data: InspectElementUserError);
// Trying to keep useful information from user's side.
// Trying to keep useful information from user's component.
const error = new UserError(message);
error.stack = stack || error.stack;
throw error;
}

case 'unsupported-feature': {
const {message} = (data: InspectElementUnsupportedFeatureError);
// Trying to keep useful information from user's side.
// Trying to keep useful information from backend.
const error = new UnsupportedFeatureError(message);
throw error;
}