Skip to content

Commit

Permalink
feat: log errors in production (#1519)
Browse files Browse the repository at this point in the history
  • Loading branch information
katywings authored May 29, 2024
1 parent ea64f7c commit 2df3d8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-dogs-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

feat: log errors in production
17 changes: 11 additions & 6 deletions packages/start/src/shared/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ export const ErrorBoundary = import.meta.env.DEV && import.meta.env.START_DEV_OV
const message = isServer ? "500 | Internal Server Error" : "Error | Uncaught Client Exception";
return (
<DefaultErrorBoundary
fallback={
<>
<span style="font-size:1.5em;text-align:center;position:fixed;left:0px;bottom:55%;width:100%;">{message}</span>
<HttpStatusCode code={500} />
</>
}
fallback={error => {
console.error(error);
return (
<>
<span style="font-size:1.5em;text-align:center;position:fixed;left:0px;bottom:55%;width:100%;">
{message}
</span>
<HttpStatusCode code={500} />
</>
);
}}
>
{props.children}
</DefaultErrorBoundary>
Expand Down

0 comments on commit 2df3d8b

Please sign in to comment.