Google.Cloud.Diagnostics.AspNetCore3 - Class ErrorReportingExceptionLoggerMiddleware (5.2.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

Google.Cloud.Diagnostics.AspNetCore3

Assembly

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 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