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.
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"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis webpage documents the \u003ccode\u003eErrorReportingExceptionLoggerMiddleware\u003c/code\u003e class, which is part of the Google Cloud Diagnostics for ASP.NET Core library (version 4.3.1).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eErrorReportingExceptionLoggerMiddleware\u003c/code\u003e is middleware designed to catch exceptions thrown by the next \u003ccode\u003eRequestDelegate\u003c/code\u003e in the pipeline.\u003c/p\u003e\n"],["\u003cp\u003eUpon catching an exception, the middleware sends a report to the Google Cloud Error Reporting API before rethrowing the exception.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eErrorReportingExceptionLoggerMiddleware\u003c/code\u003e constructor takes a \u003ccode\u003eRequestDelegate\u003c/code\u003e and an \u003ccode\u003eIExceptionLogger\u003c/code\u003e as parameters to control the request flow and handle exception reporting.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eInvoke\u003c/code\u003e method is used to execute the next \u003ccode\u003eRequestDelegate\u003c/code\u003e in the chain and is responsible for exception handling and reporting to the Google Cloud Error Reporting API, with the method accepting a \u003ccode\u003eHttpContext\u003c/code\u003e parameter.\u003c/p\u003e\n"]]],[],null,[]]