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\u003eThe \u003ccode\u003eErrorReportingExceptionLoggerMiddleware\u003c/code\u003e class catches exceptions thrown by the next \u003ccode\u003eRequestDelegate\u003c/code\u003e, reports them to the Google Cloud Error Reporting API, and then rethrows the exception.\u003c/p\u003e\n"],["\u003cp\u003eThis middleware is part of the \u003ccode\u003eGoogle.Cloud.Diagnostics.AspNetCore3\u003c/code\u003e namespace and is located within the \u003ccode\u003eGoogle.Cloud.Diagnostics.AspNetCore3.dll\u003c/code\u003e assembly.\u003c/p\u003e\n"],["\u003cp\u003eIt includes an \u003ccode\u003eInvoke\u003c/code\u003e method that handles the exception catching and reporting process during request execution using the \u003ccode\u003eHttpContext\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe constructor of \u003ccode\u003eErrorReportingExceptionLoggerMiddleware\u003c/code\u003e requires two parameters: a \u003ccode\u003eRequestDelegate\u003c/code\u003e named \u003ccode\u003enext\u003c/code\u003e and an \u003ccode\u003eIExceptionLogger\u003c/code\u003e named \u003ccode\u003elogger\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the library that this middleware is part of is 5.2.0, with 4.3.1 being the specific version of the documentation.\u003c/p\u003e\n"]]],[],null,[]]