Class HttpContextExceptionsMiddleware
Defines a middleware for handling JSON exceptions.
Inheritance
System.Object
HttpContextExceptionsMiddleware
Namespace: MADE.Web.Exceptions
Assembly: MADE.Web.dll
Syntax
public class HttpContextExceptionsMiddleware : object
Constructors
| Improve this Doc View SourceHttpContextExceptionsMiddleware(RequestDelegate, IHostEnvironment, IServiceProvider, IHttpContextExceptionHandler<Exception>)
Initializes a new instance of the HttpContextExceptionsMiddleware class.
Declaration
public HttpContextExceptionsMiddleware(RequestDelegate httpRequestDelegate, IHostEnvironment hostEnvironment, IServiceProvider serviceProvider, IHttpContextExceptionHandler<Exception> defaultExceptionHandler)
Parameters
Type | Name | Description |
---|---|---|
RequestDelegate | httpRequestDelegate | The request delegate for processing a HTTP request. |
IHostEnvironment | hostEnvironment | The host environment. |
IServiceProvider | serviceProvider | The service provider. |
IHttpContextExceptionHandler<Exception> | defaultExceptionHandler | The default exception handler. |
Methods
| Improve this Doc View SourceInvoke(HttpContext)
Invokes the middleware to perform the request and handle any exceptions thrown.
Declaration
public async Task Invoke(HttpContext context)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context | The |
Returns
Type | Description |
---|---|
Task | An asynchronous operation. |