josephwoodward / GlobalExceptionHandlerDotNet

Exception handling as a convention in the ASP.NET Core request pipeline
MIT License
269 stars 32 forks source link

Add property to indicate whether the exception has handled or not #26

Open josephwoodward opened 5 years ago

josephwoodward commented 5 years ago

When logging, there would be times where you'd like to know whether the exception was one configured.

Example:

x.OnError((context, exception, httpContext) =>
{
    if (!context.wasCaught){
        _logger.Error(exception.Message);
    }
    return Task.CompletedTask;
});