示例#1
0
 public async Task Exceptions()
 {
     if (User.Identity.IsAuthenticated && User.Identity.Name.Equals(_configuration["ExceptionUserId"], StringComparison.InvariantCultureIgnoreCase))
     {
         await ExceptionalMiddleware.HandleRequestAsync(HttpContext).ConfigureAwait(false);
     }
 }
 public static void UseExceptionalErrorPage(this IApplicationBuilder app)
 {
     // using exceptional to handle error pages
     app.Map(new PathString("/exceptions"), action => action.Use(async(context, next) =>
     {
         await ExceptionalMiddleware.HandleRequestAsync(context);
     }));
 }
 public async Task Exceptions() => await ExceptionalMiddleware.HandleRequestAsync(HttpContext);
示例#4
0
 /// <summary>
 /// This lets you access the error handler via a route in your application, secured by whatever
 /// mechanisms are already in place.
 /// </summary>
 /// <remarks>If mapping via RouteAttribute: [Route("errors/{path?}/{subPath?}")]</remarks>
 public async Task Exceptions() => await ExceptionalMiddleware.HandleRequestAsync(HttpContext).ConfigureAwait(false);
示例#5
0
 public Task InvokeErrorHandler() => ExceptionalMiddleware.HandleRequestAsync(HttpContext);