diff options
author | 2021-09-09 05:40:07 -0700 | |
---|---|---|
committer | 2021-09-09 05:40:07 -0700 | |
commit | 8a02ad48a5eb1319c1bf3e9eb97e013924db875f (patch) | |
tree | 0d82d072026501e6e8086712764a1b9b45f87218 /examples/hello-next/bun-framework-next | |
parent | c30ec608b1484628cc28b4811b9d62e1c142b281 (diff) | |
download | bun-8a02ad48a5eb1319c1bf3e9eb97e013924db875f.tar.gz bun-8a02ad48a5eb1319c1bf3e9eb97e013924db875f.tar.zst bun-8a02ad48a5eb1319c1bf3e9eb97e013924db875f.zip |
fetc h!!!
Diffstat (limited to 'examples/hello-next/bun-framework-next')
-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 |
2 files changed, 27 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"> |