Exemplo n.º 1
0
        public async Task Handle(HttpContext context)
        {
            context.Response.StatusCode  = (int)HttpStatusCode.InternalServerError;
            context.Response.ContentType = "application/json";

            var contextFeature = context.Features.Get <IExceptionHandlerFeature>();

            if (contextFeature != null)
            {
                _logger.Write(LogLevel.Error, $"{EventCodes.InternalServerError} - {contextFeature.Error.Message}");

                await _exceptionWriter.WriteResponse(context);
            }
        }