File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export function Preview({
54
54
55
55
// When throwing a new Error in Sandpack - we want to disable the dev error dialog
56
56
// to show the Error Boundary fallback
57
- if ( rawError && rawError . message . includes ( `throw Error( 'Example error')` ) ) {
57
+ if ( rawError && rawError . message . includes ( 'Example Error:' ) ) {
58
58
rawError = null ;
59
59
}
60
60
Original file line number Diff line number Diff line change @@ -1520,15 +1520,15 @@ import { ErrorBoundary } from "react-error-boundary";
1520
1520
export function AddCommentContainer () {
1521
1521
return (
1522
1522
< ErrorBoundary fallback= {< p> ⚠️Something went wrong< / p> }>
1523
- < AddCommentButton / >
1523
+ < AddCommentButton / >
1524
1524
< / ErrorBoundary>
1525
1525
);
1526
1526
}
1527
1527
1528
1528
function addComment (comment ) {
1529
1529
// For demonstration purposes to show Error Boundary
1530
- if (comment == null ){
1531
- throw Error (' Example error' )
1530
+ if (comment == null ) {
1531
+ throw new Error (" Example Error: An error thrown to trigger error boundary " );
1532
1532
}
1533
1533
}
1534
1534
@@ -1544,9 +1544,10 @@ function AddCommentButton() {
1544
1544
// so error gets thrown
1545
1545
addComment ();
1546
1546
});
1547
- }}>
1548
- Add comment
1549
- < / button>
1547
+ }}
1548
+ >
1549
+ Add comment
1550
+ < / button>
1550
1551
);
1551
1552
}
1552
1553
` ` `
You can’t perform that action at this time.
0 commit comments