Example #1
0
        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);
        }
Example #2
0
 public ValueTask <ExceptionHandlingResult> HandleExceptionAsync(
     Exception exception,
     ExceptionMappingContext mappingContext)
 {
     return(ExceptionHandlingResult.Rethrow(exception));
 }
Example #3
0
 public ValueTask <ExceptionHandlingResult> HandleExceptionAsync(
     Exception exception,
     ExceptionMappingContext mappingContext)
 {
     return(default);