Skip to content

Use NumberFormatException in baggage decoder#8593

Open
ADITYA-CODE-SOURCE wants to merge 1 commit into
open-telemetry:mainfrom
ADITYA-CODE-SOURCE:issue-8556-baggage-number-format
Open

Use NumberFormatException in baggage decoder#8593
ADITYA-CODE-SOURCE wants to merge 1 commit into
open-telemetry:mainfrom
ADITYA-CODE-SOURCE:issue-8556-baggage-number-format

Conversation

@ADITYA-CODE-SOURCE

Copy link
Copy Markdown
Contributor

Summary

  • replace the invalid hex-digit exception in BaggageCodec.digit16(byte) with NumberFormatException
  • include byte and character details in the error message
  • add a focused regression test for invalid hex input

Fixes #8556

Testing

  • ./gradlew :api:all:test --tests "*BaggageCodecTest" --tests "*W3CBaggagePropagatorTest"
  • ./gradlew :api:all:spotlessCheck

@jack-berg

Copy link
Copy Markdown
Member

Seems reasonable enough. Rebase on main to get CI to pass

@ADITYA-CODE-SOURCE ADITYA-CODE-SOURCE force-pushed the issue-8556-baggage-number-format branch from 1ba8136 to e95d4e7 Compare July 16, 2026 14:53
@ADITYA-CODE-SOURCE ADITYA-CODE-SOURCE marked this pull request as ready for review July 16, 2026 14:53
@ADITYA-CODE-SOURCE ADITYA-CODE-SOURCE requested a review from a team as a code owner July 16, 2026 14:53
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.63%. Comparing base (ee9b063) to head (e95d4e7).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8593   +/-   ##
=========================================
  Coverage     91.63%   91.63%           
  Complexity    10326    10326           
=========================================
  Files          1013     1013           
  Lines         27295    27295           
  Branches       3205     3205           
=========================================
+ Hits          25011    25012    +1     
  Misses         1558     1558           
+ Partials        726      725    -1     

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace IllegalArgumentException with NumberFormatException to improve error message formatting

2 participants