Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(errorboundary): format stack trace properly #3931

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions platform/ui/src/components/ErrorBoundary/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ const DefaultFallback = ({ error, context, resetErrorBoundary, fallbackRoute })
<p className="text-primary-light text-base">{subtitle}</p>
{!isProduction && (
<div className="bg-secondary-dark mt-5 space-y-2 rounded-md p-5 font-mono">
<p className="text-primary-light">{t('Context')}: {context}</p>
<p className="text-primary-light">{t('Error Message')}: {error.message}</p>
<p className="text-primary-light">
{t('Context')}: {context}
</p>
<p className="text-primary-light">
{t('Error Message')}: {error.message}
</p>

<IconButton
variant="contained"
Expand All @@ -44,7 +48,9 @@ const DefaultFallback = ({ error, context, resetErrorBoundary, fallbackRoute })
</React.Fragment>
</IconButton>

{showDetails && <p className="text-primary-light px-4">Stack: {error.stack}</p>}
{showDetails && (
<pre className="text-primary-light whitespace-pre-wrap px-4">Stack: {error.stack}</pre>
)}
</div>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion platform/ui/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const Modal = ({

return (
<ReactModal
className="relative max-h-full w-11/12 text-white outline-none lg:w-10/12 xl:w-1/2"
className="relative max-h-full w-11/12 text-white outline-none lg:w-10/12 xl:w-9/12"
overlayClassName="fixed top-0 left-0 right-0 bottom-0 z-50 bg-overlay flex items-start justify-center py-16"
shouldCloseOnEsc={shouldCloseOnEsc}
onRequestClose={handleClose}
Expand Down
Loading