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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-17 UTC."],[[["The `ErrorReportingExceptionLoggerMiddleware` class is designed to catch exceptions thrown by a `RequestDelegate`, report them to the Google Cloud Error Reporting API, and then rethrow the exception."],["This middleware requires a `RequestDelegate` and an `IExceptionLogger` during its construction to function properly, neither of which can be null."],["The `Invoke` method is the primary function of this middleware, where it executes the next `RequestDelegate`, catches exceptions, reports them, and rethrows them."],["This class is part of the Google Cloud Diagnostics for ASP.NET Core 3 library, specifically found within the `Google.Cloud.Diagnostics.AspNetCore3` namespace."],["Several previous versions of the middleware are available, spanning from version 4.3.1 to the most recent 5.2.0."]]],[]]