Skip to content

fix: Include backend error in OTLP conversion error message#3827

Merged
yurishkuro merged 2 commits into
jaegertracing:mainfrom
yurishkuro:otlp-error
May 8, 2026
Merged

fix: Include backend error in OTLP conversion error message#3827
yurishkuro merged 2 commits into
jaegertracing:mainfrom
yurishkuro:otlp-error

Conversation

@yurishkuro

@yurishkuro yurishkuro commented May 8, 2026

Copy link
Copy Markdown
Member

Which problem is this PR solving?

  • When uploading an OTLP-formatted trace file that fails the backend conversion, the error shown to the user was always the generic "Error converting traces to OTLP" with no indication of what actually went wrong.

Description of the changes

  • Propagate the underlying error message from the transformOTLP API call into the user-facing error, so the message now reads "Error converting traces to OTLP: " when the backend provides one.
  • Updated the test mock to reject with an actual Error object and tightened the assertion to verify the backend cause is included in the error message.

How was this change tested?

  • Existing unit tests in readJsonFile.test.js updated and passing.

AI Usage in this PR (choose one)

specific parts

  • Heavy: AI generated most or all of the code changes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Copilot AI review requested due to automatic review settings May 8, 2026 15:53
@yurishkuro
yurishkuro requested a review from a team as a code owner May 8, 2026 15:53
@yurishkuro yurishkuro added the changelog:bugfix-or-minor-feature 🐞 Bug fixes, Minor Improvements label May 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the OTLP file-import path to surface backend transform failures in the user-visible error, improving debugging when OTLP→Jaeger conversion fails.

Changes:

  • Include the backend error message when JaegerAPI.transformOTLP() rejects during OTLP import.
  • Update the corresponding unit test to assert that the backend error detail is present in the thrown message.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/jaeger-ui/src/utils/readJsonFile.ts Appends the backend rejection message to the OTLP transform failure error.
packages/jaeger-ui/src/utils/readJsonFile.test.js Adjusts the mock rejection and asserts the new error-message behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/jaeger-ui/src/utils/readJsonFile.ts Outdated
Comment thread packages/jaeger-ui/src/utils/readJsonFile.ts Outdated
Comment thread packages/jaeger-ui/src/utils/readJsonFile.test.js Outdated
@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.58%. Comparing base (db87b9a) to head (5851447).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3827   +/-   ##
=======================================
  Coverage   90.58%   90.58%           
=======================================
  Files         333      333           
  Lines       10483    10484    +1     
  Branches     2736     2737    +1     
=======================================
+ Hits         9496     9497    +1     
  Misses        860      860           
  Partials      127      127           

☔ 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.

- Change "Error converting traces to OTLP" to "Error converting OTLP
  trace to Jaeger" to accurately reflect the direction of conversion
- Pass { cause: err } to preserve the original error for debugging

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines +58 to +59
const cause = err instanceof Error ? `: ${err.message}` : '';
reject(new Error(`Error converting OTLP trace to Jaeger${cause}`, { cause: err }));
Comment on lines +58 to 60
const cause = err instanceof Error ? `: ${err.message}` : '';
reject(new Error(`Error converting OTLP trace to Jaeger${cause}`, { cause: err }));
});
@yurishkuro
yurishkuro merged commit b03fac4 into jaegertracing:main May 8, 2026
19 checks passed
@yurishkuro
yurishkuro deleted the otlp-error branch May 8, 2026 16:44
M-DEV-1 pushed a commit to M-DEV-1/jaeger-ui that referenced this pull request May 25, 2026
…acing#3827)

## Which problem is this PR solving?
- When uploading an OTLP-formatted trace file that fails the backend
conversion, the error shown to the user was always the generic "Error
converting traces to OTLP" with no indication of what actually went
wrong.

## Description of the changes
- Propagate the underlying error message from the `transformOTLP` API
call into the user-facing error, so the message now reads "Error
converting traces to OTLP: <backend reason>" when the backend provides
one.
- Updated the test mock to reject with an actual `Error` object and
tightened the assertion to verify the backend cause is included in the
error message.

## How was this change tested?
- Existing unit tests in `readJsonFile.test.js` updated and passing.

## AI Usage in this PR (choose one)
specific parts
- [x] **Heavy**: AI generated most or all of the code changes

---------

Signed-off-by: Yuri Shkuro <github@ysh.us>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Harizz076 pushed a commit to Harizz076/jaeger-ui that referenced this pull request Jul 4, 2026
…acing#3827)

## Which problem is this PR solving?
- When uploading an OTLP-formatted trace file that fails the backend
conversion, the error shown to the user was always the generic "Error
converting traces to OTLP" with no indication of what actually went
wrong.

## Description of the changes
- Propagate the underlying error message from the `transformOTLP` API
call into the user-facing error, so the message now reads "Error
converting traces to OTLP: <backend reason>" when the backend provides
one.
- Updated the test mock to reject with an actual `Error` object and
tightened the assertion to verify the backend cause is included in the
error message.

## How was this change tested?
- Existing unit tests in `readJsonFile.test.js` updated and passing.

## AI Usage in this PR (choose one)
specific parts
- [x] **Heavy**: AI generated most or all of the code changes

---------

Signed-off-by: Yuri Shkuro <github@ysh.us>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:bugfix-or-minor-feature 🐞 Bug fixes, Minor Improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants