Skip to content

[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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

TackAdam
Copy link
Collaborator

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:
FailedToParseFieldSize

Issues Resolved

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

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.

Signed-off-by: Adam Tackett <[email protected]>
@TackAdam TackAdam added the bug Something isn't working label Jun 13, 2025
@TackAdam TackAdam marked this pull request as ready for review June 13, 2025 22:35
@@ -158,7 +158,10 @@ export function registerTraceAnalyticsDslRouter(router: IRouter, dataSourceEnabl
if (error.statusCode !== 404) console.error(error);
return response.custom({
statusCode: error.statusCode || 400,
Copy link
Member

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.

Copy link
Collaborator Author

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 and status properties, with statusCode being checked first.

  • Changing to error.status would break consistency with the rest of the codebase, which exclusively uses error.statusCode.

  • The current implementation follows the established pattern across all router files in the project.

Copy link

codecov bot commented Jul 15, 2025

Codecov Report

Attention: Patch coverage is 82.14286% with 5 lines in your changes missing coverage. Please review.

Project coverage is 56.35%. Comparing base (c33aad8) to head (0154818).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ents/trace_analytics/requests/helper_functions.tsx 82.14% 5 Missing ⚠️
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     
Flag Coverage Δ
dashboards-observability 56.35% <82.14%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants