Google.Cloud.Diagnostics.AspNetCore3 - Class ErrorReportingExceptionLoggerMiddleware (5.1.0)

public sealed class ErrorReportingExceptionLoggerMiddleware

Reference documentation and code samples for the Google.Cloud.Diagnostics.AspNetCore3 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.

Inheritance

object > ErrorReportingExceptionLoggerMiddleware

Namespace

GoogleCloudGoogle.Cloud.DiagnosticsAspNetCore3

Assembly

Google.Cloud.Diagnostics.AspNetCore3.dll

Constructors

ErrorReportingExceptionLoggerMiddleware(RequestDelegate, IExceptionLogger)

public ErrorReportingExceptionLoggerMiddleware(RequestDelegate next, IExceptionLogger logger)

Create a new instance of ErrorReportingExceptionLoggerMiddleware.

Parameters
NameDescription
nextRequestDelegate

The next request delegate. Must not be null.

loggerIExceptionLogger

A logger that will report exceptions. Must not be null.

Methods

Invoke(HttpContext)

public 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
NameDescription
httpContextHttpContext
Returns
TypeDescription
Task