-
Notifications
You must be signed in to change notification settings - Fork 66
[Traces] Toast Error handling #2463
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Adam Tackett <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
@@ -158,7 +158,10 @@ export function registerTraceAnalyticsDslRouter(router: IRouter, dataSourceEnabl | |||
if (error.statusCode !== 404) console.error(error); | |||
return response.custom({ | |||
statusCode: error.statusCode || 400, |
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.
Should the error.statusCode
be changed to error.status
? I see the special parsing done in the UI layer in the helper function.
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 think checking statusCode is correct:
-
The helper function is already designed to handle both
statusCode
andstatus
properties, withstatusCode
being checked first. -
Changing to
error.status
would break consistency with the rest of the codebase, which exclusively useserror.statusCode
. -
The current implementation follows the established pattern across all router files in the project.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2463 +/- ##
==========================================
+ Coverage 56.29% 56.35% +0.05%
==========================================
Files 398 398
Lines 16121 16153 +32
Branches 4490 4501 +11
==========================================
+ Hits 9076 9103 +27
- Misses 6967 6971 +4
- Partials 78 79 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Update the toast message to be more robust and always dispaly error to keep user informed. And ensure fallback error message to cover all cases.
Add testing.
Before silently failing error example:
Crash.mov
New error handling example:
503Error.mov
No errors on empty data:
EmptyDataNoError.mov
Failed to parse field example:

Issues Resolved
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.