Skip to content

chore: Add defensive exception handling to MassTransitHelpers#3532

Merged
tippmar-nr merged 1 commit intomainfrom
chore/masstransit-helpers-defensive-exception-handling
Apr 13, 2026
Merged

chore: Add defensive exception handling to MassTransitHelpers#3532
tippmar-nr merged 1 commit intomainfrom
chore/masstransit-helpers-defensive-exception-handling

Conversation

@tippmar-nr
Copy link
Copy Markdown
Member

Summary

  • Make MassTransitHelpers a static class
  • Wrap URI parsing in GetQueueDataFromUri with a try-catch so no exceptions propagate to callers (e.g. relative URIs, malformed percent-encoding). On failure, returns default MassTransitQueueData with "Unknown" queue name.

Test plan

  • All 54 existing MassTransitHelperTests pass
  • MassTransit and MassTransitLegacy wrapper projects build cleanly

Make MassTransitHelpers a static class and wrap URI parsing in
GetQueueDataFromUri with a try-catch to prevent exceptions from
propagating to callers (e.g. relative URIs, malformed percent-encoding).
On any failure, returns default MassTransitQueueData with "Unknown"
queue name.
@tippmar-nr tippmar-nr marked this pull request as ready for review April 13, 2026 16:39
@tippmar-nr tippmar-nr requested a review from a team as a code owner April 13, 2026 16:39
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.37838% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.79%. Comparing base (62bdb44) to head (e2100ac).

Files with missing lines Patch % Lines
...s/NewRelic.Agent.Extensions/Helpers/MassTransit.cs 78.37% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3532   +/-   ##
=======================================
  Coverage   81.79%   81.79%           
=======================================
  Files         508      508           
  Lines       34365    34369    +4     
  Branches     4067     4067           
=======================================
+ Hits        28108    28112    +4     
- Misses       5285     5288    +3     
+ Partials      972      969    -3     
Flag Coverage Δ
Agent 82.78% <78.37%> (+<0.01%) ⬆️
Profiler 71.75% <ø> (ø)

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

Files with missing lines Coverage Δ
...s/NewRelic.Agent.Extensions/Helpers/MassTransit.cs 86.25% <78.37%> (-1.93%) ⬇️

... and 1 file with indirect coverage changes

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

Copy link
Copy Markdown
Member

@jaffinito jaffinito left a comment

Choose a reason for hiding this comment

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

LGTM

@tippmar-nr tippmar-nr enabled auto-merge (squash) April 13, 2026 17:08
@tippmar-nr tippmar-nr merged commit 597e65b into main Apr 13, 2026
223 of 225 checks passed
@tippmar-nr tippmar-nr deleted the chore/masstransit-helpers-defensive-exception-handling branch April 13, 2026 17:13
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.

3 participants