public sealed class ErrorReportingExceptionLoggerMiddleware
Middleware that will, when invoked, call the next RequestDelegate, catch any exception that it may throw, send that exception to the Google Cloud Error Reporting API and rethrow the given exception.
Namespace
Google.Cloud.Diagnostics.AspNetCore3Assembly
Google.Cloud.Diagnostics.AspNetCore3.dll
Constructors
ErrorReportingExceptionLoggerMiddleware(RequestDelegate, IExceptionLogger)
public ErrorReportingExceptionLoggerMiddleware(RequestDelegate next, IExceptionLogger logger)
Create a new instance of ErrorReportingExceptionLoggerMiddleware.
Parameters | |
---|---|
Name | Description |
next | RequestDelegate The next request delegate. Must not be null. |
logger | IExceptionLogger A logger that will report exceptions. Must not be null. |
Methods
Invoke(HttpContext)
public async Task Invoke(HttpContext httpContext)
Invokes the next RequestDelegate, catches any exception thrown, reports the exception to the Google Cloud Error Reporting API and rethrows the exception.
Parameter | |
---|---|
Name | Description |
httpContext | HttpContext |
Returns | |
---|---|
Type | Description |
Task |