diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/hello-next/bun-framework-next/bun-error.css | 1 | ||||
-rw-r--r-- | examples/hello-next/bun-framework-next/bun-error.tsx | 26 | ||||
-rw-r--r-- | examples/hello-next/package.json | 3 |
3 files changed, 30 insertions, 0 deletions
diff --git a/examples/hello-next/bun-framework-next/bun-error.css b/examples/hello-next/bun-framework-next/bun-error.css index 64801411f..c5ed9881b 100644 --- a/examples/hello-next/bun-framework-next/bun-error.css +++ b/examples/hello-next/bun-framework-next/bun-error.css @@ -124,6 +124,7 @@ a:hover { .BunError-NativeStackTrace { margin-top: 0; + width: 100%; } .BunError-NativeStackTrace-filename { diff --git a/examples/hello-next/bun-framework-next/bun-error.tsx b/examples/hello-next/bun-framework-next/bun-error.tsx index 5702f66e6..5d57dd0ea 100644 --- a/examples/hello-next/bun-framework-next/bun-error.tsx +++ b/examples/hello-next/bun-framework-next/bun-error.tsx @@ -555,6 +555,32 @@ const JSException = ({ value }: { value: JSExceptionType }) => { } default: { + const newline = value.message.indexOf("\n"); + if (newline > -1) { + const subtitle = value.message.substring(newline + 1).trim(); + const message = value.message.substring(0, newline).trim(); + if (subtitle.length) { + return ( + <div className={`BunError-JSException`}> + <div className="BunError-error-header"> + <div className={`BunError-error-code`}>{value.name}</div> + {errorTags[ErrorTagType.server]} + </div> + + <div className={`BunError-error-message`}>{message}</div> + <div className={`BunError-error-subtitle`}>{subtitle}</div> + + {value.stack && ( + <NativeStackTrace + frames={value.stack.frames} + sourceLines={value.stack.source_lines} + /> + )} + </div> + ); + } + } + return ( <div className={`BunError-JSException`}> <div className="BunError-error-header"> diff --git a/examples/hello-next/package.json b/examples/hello-next/package.json index a9829d2e2..1ce5e4982 100644 --- a/examples/hello-next/package.json +++ b/examples/hello-next/package.json @@ -4,12 +4,15 @@ "main": "index.js", "license": "MIT", "dependencies": { + "isomorphic-fetch": "^3.0.0", "next": "^11.1.0", "parcel": "2.0.0-rc.0", "path-browserify": "^1.0.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-is": "^17.0.2", + "react-static-tweets": "^0.5.4", + "static-tweets": "^0.5.5", "whatwg-url": "^9.1.0" }, "devDependencies": { |