internal static void UseErrorHandling(this IApplicationBuilder app, IWebHostEnvironment env) { var options = new ErrorHandlingOptions { ShowStackTrace = false }; if (env.IsDevelopment()) { options.ShowStackTrace = true; } app.UseMiddleware <ErrorHandlingMiddleware>(options); }
public ErrorHandlingMiddleware(RequestDelegate next, ErrorHandlingOptions options) { _next = next; _options = options; }