Serilog.Exceptions icon indicating copy to clipboard operation
Serilog.Exceptions copied to clipboard

feat: added ValidationApiExceptionDestructurer and unit tests.

Open DavidRogersDev opened this issue 2 years ago • 0 comments

Background

On a project which I am working on, we noticed that Bearer tokens were being logged to Seq with Refit exceptions, despite the fact that we were using the ApiExceptionDestructurer. On a closer inspection, we discovered that it was a ValidationApiException which Refit was throwing and this was not covered by the ApiExceptionDestructurer.

After discussing whether to change the ApiExceptionDestructurer or create a new destructurer, we settled on that, making it easy to mix and match the destructurers to suit an API's needs.

To that end, I'm submitting this PR to add the ValidationApiExceptionDestructurer to handle ValidationApiExceptions thrown by Refit.

DavidRogersDev avatar Oct 06 '23 06:10 DavidRogersDev