private async Task HandleExceptionAsync(HttpContext context, Exception exception) { _logAs.Critical("Unhandled scenario encountered.", exception); context.Response.ContentType = "application/json"; context.Response.StatusCode = (int)HttpStatusCode.InternalServerError; const string error = @"{""error"":{""code"":""UnhandledServerError"",""message"":""Please contact software development team to fix this issue."",""details"":[{""code"":""unhandled"",""message"":""Unhandled scenario encountered."",""target"":""global""}]}}"; await context.Response.WriteAsync(error); }
public static void ServiceInitalizationFailed(this ILogAs logAs, string serviceTypeName, Exception exception) { logAs.Critical(string.Format("Service {0} failed to initialize.", serviceTypeName), exception); }