Skip to content

chore: Add debug logging for MassTransit URI parsing exceptions#3533

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

chore: Add debug logging for MassTransit URI parsing exceptions#3533
tippmar-nr merged 1 commit intomainfrom
chore/masstransit-exception-logging

Conversation

@tippmar-nr
Copy link
Copy Markdown
Member

Summary

Add Log.Debug call in the MassTransitHelpers.GetQueueDataFromUri catch block to log exceptions that occur during URI parsing, following the same pattern used by other connection string parsers in the Extensions library (e.g., MsSqlConnectionStringParser, MySqlConnectionStringParser).

Changes

  • MassTransit.cs: Log the caught exception via Log.Debug(ex, ...) instead of silently swallowing it.
  • MassTransitHelperTests.cs: Add GetQueueData_ReturnsDefaults_WhenParsingThrows test that passes a relative URI to exercise the catch block and verify default values are returned.

Log caught exceptions in MassTransitHelpers.GetQueueDataFromUri using Log.Debug, following the pattern used by other connection string parsers in the Extensions library. Add unit test to verify the catch block returns default values.

Co-authored-by: GitHub Copilot <copilot@github.com>
@tippmar-nr tippmar-nr marked this pull request as ready for review April 13, 2026 18:12
@tippmar-nr tippmar-nr requested a review from a team as a code owner April 13, 2026 18:12
@tippmar-nr tippmar-nr enabled auto-merge (squash) April 13, 2026 18:23
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.81%. Comparing base (597e65b) to head (5d4fd5b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3533      +/-   ##
==========================================
+ Coverage   81.79%   81.81%   +0.02%     
==========================================
  Files         508      508              
  Lines       34369    34370       +1     
  Branches     4067     4067              
==========================================
+ Hits        28112    28120       +8     
+ Misses       5288     5277      -11     
- Partials      969      973       +4     
Flag Coverage Δ
Agent 82.80% <100.00%> (+0.02%) ⬆️
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 88.63% <100.00%> (+2.37%) ⬆️

... and 4 files 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.

@tippmar-nr tippmar-nr merged commit a6ec23f into main Apr 13, 2026
123 of 124 checks passed
@tippmar-nr tippmar-nr deleted the chore/masstransit-exception-logging branch April 13, 2026 20:42
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