Skip to content

#2376 Refactor: implement extensible IExceptionMapper strategy for handling HTTP exceptions and add InvalidRequestError support#2381

Open
nhmatsumoto wants to merge 1 commit intoThreeMammals:developfrom
nhmatsumoto:develop
Open

#2376 Refactor: implement extensible IExceptionMapper strategy for handling HTTP exceptions and add InvalidRequestError support#2381
nhmatsumoto wants to merge 1 commit intoThreeMammals:developfrom
nhmatsumoto:develop

Conversation

@nhmatsumoto
Copy link
Copy Markdown

@nhmatsumoto nhmatsumoto commented Apr 13, 2026

… HTTP exceptions and add InvalidRequestError support
Copy link
Copy Markdown
Author

@nhmatsumoto nhmatsumoto left a comment

Choose a reason for hiding this comment

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

@nhmatsumoto nhmatsumoto changed the title refactor: implement extensible IExceptionMapper strategy for handling HTTP exceptions and add InvalidRequestError support #2376 Refactor: implement extensible IExceptionMapper strategy for handling HTTP exceptions and add InvalidRequestError support Apr 13, 2026
Copy link
Copy Markdown
Author

@nhmatsumoto nhmatsumoto left a comment

Choose a reason for hiding this comment

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

Review

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.50%. Comparing base (5eeb9cc) to head (63e0317).

Files with missing lines Patch % Lines
src/Ocelot/Requester/IExceptionMapper.cs 80.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2381      +/-   ##
===========================================
- Coverage    91.55%   91.50%   -0.05%     
===========================================
  Files          296      298       +2     
  Lines         5876     5901      +25     
  Branches       799      804       +5     
===========================================
+ Hits          5380     5400      +20     
- Misses         385      388       +3     
- Partials       111      113       +2     
Flag Coverage Δ
unittests 91.50% <87.87%> (-0.05%) ⬇️

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

Files with missing lines Coverage Δ
src/Ocelot/DependencyInjection/OcelotBuilder.cs 100.00% <100.00%> (ø)
src/Ocelot/Request/Mapper/InvalidRequestError.cs 100.00% <100.00%> (ø)
src/Ocelot/Requester/HttpExceptionToErrorMapper.cs 100.00% <100.00%> (ø)
...c/Ocelot/Responder/ErrorsToHttpStatusCodeMapper.cs 85.18% <100.00%> (+1.18%) ⬆️
src/Ocelot/Requester/IExceptionMapper.cs 80.00% <80.00%> (ø)

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

@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 92.509% (-0.02%) from 92.525% — nhmatsumoto:develop into ThreeMammals:develop

@raman-m
Copy link
Copy Markdown
Member

raman-m commented Apr 13, 2026

Hello, Hiro!
Welcome to the world of Ocelot! 🐯

Thanks for submitting this PR. As far as I understand, you are proposing an enhancement to the error handling logic, and this is not a bug-fixing pull request, correct?
If so, please note that this PR will be delivered after the currently accepted #2379, which I consider an official bug fix.
Since I am very busy with the current .NET 10 release, I will return to your PR after the release is made.
Until then, you are free to develop this PR further, polish the logic, and try to follow our development process.

I will point you in the right direction including pressing the CI build button 😄 Please be patient, as delivery depends on #2379 and the .NET 10 release. After that, I will return to this PR.

@raman-m
Copy link
Copy Markdown
Member

raman-m commented Apr 13, 2026

nhmatsumoto:develop

It is not recommended to use the default branch as a feature branch in a forked repository, because at least one branch must remain as the default and stay synced with the upstream. After the PR is merged, you will have to hard reset the develop branch.

@nhmatsumoto
Copy link
Copy Markdown
Author

Hello, Hiro! Welcome to the world of Ocelot! 🐯

Thanks for submitting this PR. As far as I understand, you are proposing an enhancement to the error handling logic, and this is not a bug-fixing pull request, correct? If so, please note that this PR will be delivered after the currently accepted #2379, which I consider an official bug fix. Since I am very busy with the current .NET 10 release, I will return to your PR after the release is made. Until then, you are free to develop this PR further, polish the logic, and try to follow our development process.

I will point you in the right direction including pressing the CI build button 😄 Please be patient, as delivery depends on #2379 and the .NET 10 release. After that, I will return to this PR.

Hello, Raman!

Thank you very much for the warm welcome. This is officially the first project I have ever contributed to.

That is correct! This is not a bug fix, but rather a behavioral improvement. I believe that by doing this, we will be able to implement new handling strategies more easily whenever needed.

This first version may still be a little rough in terms of formatting, but I will keep improving it step by step until it becomes more refined.

Thank you for the support. As soon as I have some free time, I will come back with further improvements, including test coverage. :D

@raman-m
Copy link
Copy Markdown
Member

raman-m commented Apr 14, 2026

This is officially the first project I have ever contributed to.

🤣 I see

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.

Matched requests that contain invalid header values (eg with emoji) return a 502 to the client

3 participants