Пример #1
0
 public async Task Invoke(HttpContext httpContext)
 {
     try
     {
         await _next.Invoke(httpContext);
     }
     catch (Exception e)
     {
         await ExceptionToHttpResponseTranslator.HandleException(httpContext.Response, e).ConfigureAwait(false);
     }
 }
Пример #2
0
 public override async Task ExecuteResultAsync(ActionContext context)
 {
     var httpResponse = context.HttpContext.Response;
     await ExceptionToHttpResponseTranslator.HandleException(httpResponse, _exception).ConfigureAwait(false);
 }