public static IApplicationBuilder HandleExceptions(this IApplicationBuilder app, Action <ExceptionHandlingOptions> options = null) { var arguments = new ExceptionHandlingOptions(); options?.Invoke(arguments); return(app.UseMiddleware <ExceptionHandlingMiddleware>(arguments)); }
public ExceptionHandlingMiddleware(RequestDelegate next, ExceptionHandlingOptions options) { next_ = next ?? throw new ArgumentNullException(nameof(next)); options_ = options ?? throw new ArgumentNullException(nameof(options)); }