Catch real errors !wip

pull/2420/head
Jamie Rees 6 years ago
parent 46ab1ad923
commit b573bc30f5

@ -31,7 +31,8 @@ namespace Ombi
private static Task HandleExceptionAsync(HttpContext context, Exception exception) private static Task HandleExceptionAsync(HttpContext context, Exception exception)
{ {
var logger = context.RequestServices.GetService<ILogger>(); var loggerFact = context.RequestServices.GetService<ILoggerFactory>();
var logger = loggerFact.CreateLogger<ErrorHandlingMiddleware>();
logger.LogError(exception, "Something bad happened, ErrorMiddleware caught this"); logger.LogError(exception, "Something bad happened, ErrorMiddleware caught this");
var code = HttpStatusCode.InternalServerError; // 500 if unexpected var code = HttpStatusCode.InternalServerError; // 500 if unexpected

Loading…
Cancel
Save