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({
5454
5555 // When throwing a new Error in Sandpack - we want to disable the dev error dialog
5656 // to show the Error Boundary fallback
57- if ( rawError && rawError . message . includes ( `throw Error( 'Example error')` ) ) {
57+ if ( rawError && rawError . message . includes ( 'Example Error:' ) ) {
5858 rawError = null ;
5959 }
6060
Original file line number Diff line number Diff line change @@ -1520,15 +1520,15 @@ import { ErrorBoundary } from "react-error-boundary";
15201520export function AddCommentContainer () {
15211521 return (
15221522 < ErrorBoundary fallback= {< p> ⚠️Something went wrong< / p> }>
1523- < AddCommentButton / >
1523+ < AddCommentButton / >
15241524 < / ErrorBoundary>
15251525 );
15261526}
15271527
15281528function addComment (comment ) {
15291529 // 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 " );
15321532 }
15331533}
15341534
@@ -1544,9 +1544,10 @@ function AddCommentButton() {
15441544 // so error gets thrown
15451545 addComment ();
15461546 });
1547- }}>
1548- Add comment
1549- < / button>
1547+ }}
1548+ >
1549+ Add comment
1550+ < / button>
15501551 );
15511552}
15521553` ` `
You can’t perform that action at this time.
0 commit comments