Пример #1
0
        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);
        }
Пример #2
0
 public ErrorHandlingMiddleware(RequestDelegate next, ErrorHandlingOptions options)
 {
     _next    = next;
     _options = options;
 }