Class ErrorReportingExceptionLoggerMiddleware (4.3.1)

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.

Inheritance

Object > ErrorReportingExceptionLoggerMiddleware

Namespace

Google.Cloud.Diagnostics.AspNetCore

Assembly

Google.Cloud.Diagnostics.AspNetCore.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