diff options
author | 2021-09-09 05:40:07 -0700 | |
---|---|---|
committer | 2021-09-09 05:40:07 -0700 | |
commit | 8a02ad48a5eb1319c1bf3e9eb97e013924db875f (patch) | |
tree | 0d82d072026501e6e8086712764a1b9b45f87218 /examples | |
parent | c30ec608b1484628cc28b4811b9d62e1c142b281 (diff) | |
download | bun-8a02ad48a5eb1319c1bf3e9eb97e013924db875f.tar.gz bun-8a02ad48a5eb1319c1bf3e9eb97e013924db875f.tar.zst bun-8a02ad48a5eb1319c1bf3e9eb97e013924db875f.zip |
fetc h!!!
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": { |