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"]],[["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 document provides reference information for the \u003ccode\u003eErrorReportingExceptionLoggerMiddleware\u003c/code\u003e class within the Google.Cloud.Diagnostics.AspNetCore3 library, specifically version 5.1.0.\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, report them to the Google Cloud Error Reporting API, and then rethrow the exception.\u003c/p\u003e\n"],["\u003cp\u003eThe middleware has a constructor that takes a \u003ccode\u003eRequestDelegate\u003c/code\u003e and an \u003ccode\u003eIExceptionLogger\u003c/code\u003e as parameters, both of which cannot be null, and is used to set the next delegate in the request pipeline and log any exceptions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eInvoke\u003c/code\u003e method is used to execute the next \u003ccode\u003eRequestDelegate\u003c/code\u003e and will report any exception thrown to the Google Cloud Error Reporting API, the method requires an \u003ccode\u003eHttpContext\u003c/code\u003e as a parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe document also includes inherited members from the \u003ccode\u003eobject\u003c/code\u003e class, such as \u003ccode\u003eGetHashCode()\u003c/code\u003e, \u003ccode\u003eGetType()\u003c/code\u003e, \u003ccode\u003eMemberwiseClone()\u003c/code\u003e, and \u003ccode\u003eToString()\u003c/code\u003e, which are part of the base class functionalities.\u003c/p\u003e\n"]]],[],null,[]]