public HttpContext?GetHttpContext(ExceptionMappingContext context) { var httpContext = context.GetHttpContext(); if (httpContext != null) { return(httpContext); } // Find in IHttpContextAccessor if the application has it added to the service collection. var accessor = _serviceProvider.GetService <IHttpContextAccessor>(); httpContext = accessor?.HttpContext; return(httpContext); }
public ValueTask <ExceptionHandlingResult> HandleExceptionAsync( Exception exception, ExceptionMappingContext mappingContext) { return(ExceptionHandlingResult.Rethrow(exception)); }
public ValueTask <ExceptionHandlingResult> HandleExceptionAsync( Exception exception, ExceptionMappingContext mappingContext) { return(default);