-
Notifications
You must be signed in to change notification settings - Fork 11
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): rework error page #1983
Conversation
e69684b
to
57d9b37
Compare
} | ||
} | ||
|
||
return ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return empty string instead of some placeholder to reduce output size in case of unknown error
57d9b37
to
ea5247e
Compare
userAgent: navigator.userAgent, | ||
error: { | ||
message: prepareErrorMessage(error), | ||
stack: prepareErrorStack(error.stack, {trim: true, maxLength: 10}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trim and limit trace to ensure it will fit in QR
} | ||
} | ||
|
||
function prepareErrorMessage(error: unknown) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use this logic?
let statusText = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this code to utils and used in ErrorBoundary
document.body.removeChild(link); | ||
} | ||
|
||
export const createAndDownloadJsonFile = (data: unknown, fileName: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you want to add downloading of error's diagnostics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it in first version, but then removed since we decided to replace it with QR. These functions now are used only in query diagnostics, but I left them in utils since they fit there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/components/ErrorBoundary/ErrorBoundary.tsx:57
- The variable 'b' is used to set the className in multiple components (e.g. in ErrorBoundaryFallback and ErrorStack) but there is no definition or import for 'b'. Make sure to import or define 'b' appropriately.
<Flex direction="column" gap={4} className={b(null)}>
Closes #1583
Where I checked my QRs:
Stand: https://nda.ya.ru/t/MrUUOOfl7CHYFg
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
😟 No changes in tests. 😕
Bundle Size: 🔺
Current: 80.72 MB | Main: 80.62 MB
Diff: +0.10 MB (0.12%)
ℹ️ CI Information