Message = " An unhandled exception has occurred" Ĭ = " application/json" Ĭ = statusCode Int statusCode = ( int)HttpStatusCode.InternalServerError // 500 string message = string.Empty _logger.LogError(exception, exception.Message) Private async Task HandleUnhandledExceptionAsync(HttpContext context, Public async Task InvokeAsync(HttpContext httpContext)Īwait HandleUnhandledExceptionAsync(httpContext, ex) Public class ExceptionsHandlingMiddleware Namespace SpeedUpCoreAPIExample.Exceptions NET Core application in Main method, we have created and run the web server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |