@@ -171,18 +171,18 @@ private async Task HandleException(HttpContext context, ExceptionDispatchInfo ed
171171 context . Response . OnStarting ( _clearCacheHeadersDelegate , context . Response ) ;
172172
173173 string ? handlerTag = null ;
174- var result = ExceptionHandlerResult . Unhandled ;
174+ var result = ExceptionHandledType . Unhandled ;
175175 foreach ( var exceptionHandler in _exceptionHandlers )
176176 {
177177 if ( await exceptionHandler . TryHandleAsync ( context , edi . SourceException , context . RequestAborted ) )
178178 {
179- result = ExceptionHandlerResult . IExceptionHandler ;
179+ result = ExceptionHandledType . ExceptionHandlerService ;
180180 handlerTag = exceptionHandler . GetType ( ) . FullName ;
181181 break ;
182182 }
183183 }
184184
185- if ( result == ExceptionHandlerResult . Unhandled )
185+ if ( result == ExceptionHandledType . Unhandled )
186186 {
187187 if ( _options . ExceptionHandler is not null )
188188 {
@@ -193,12 +193,12 @@ private async Task HandleException(HttpContext context, ExceptionDispatchInfo ed
193193 {
194194 if ( _options . ExceptionHandlingPath . HasValue )
195195 {
196- result = ExceptionHandlerResult . ExceptionHandlingPath ;
196+ result = ExceptionHandledType . ExceptionHandlingPath ;
197197 handlerTag = _options . ExceptionHandlingPath . Value ;
198198 }
199199 else
200200 {
201- result = ExceptionHandlerResult . ExceptionHandler ;
201+ result = ExceptionHandledType . ExceptionHandlerCallback ;
202202 }
203203 }
204204 }
@@ -212,13 +212,13 @@ private async Task HandleException(HttpContext context, ExceptionDispatchInfo ed
212212 Exception = edi . SourceException ,
213213 } ) )
214214 {
215- result = ExceptionHandlerResult . ProblemDetailsService ;
215+ result = ExceptionHandledType . ProblemDetailsService ;
216216 handlerTag = _problemDetailsService . GetType ( ) . FullName ;
217217 }
218218 }
219219 }
220220
221- if ( result != ExceptionHandlerResult . Unhandled || _options . StatusCodeSelector != null || context . Response . StatusCode != StatusCodes . Status404NotFound || _options . AllowStatusCode404Response )
221+ if ( result != ExceptionHandledType . Unhandled || _options . StatusCodeSelector != null || context . Response . StatusCode != StatusCodes . Status404NotFound || _options . AllowStatusCode404Response )
222222 {
223223 var suppressLogging = false ;
224224
@@ -227,7 +227,12 @@ private async Task HandleException(HttpContext context, ExceptionDispatchInfo ed
227227 // Run the configured callback to determine if the exception logging in middleware should be suppressed.
228228 if ( _options . SuppressLoggingCallback is { } suppressLoggingCallback )
229229 {
230- var logContext = new ExceptionHandlerSuppressLoggingContext { Exception = edi . SourceException , HandlerResult = result } ;
230+ var logContext = new ExceptionHandlerSuppressLoggingContext
231+ {
232+ HttpContext = context ,
233+ Exception = edi . SourceException ,
234+ ExceptionHandledBy = result
235+ } ;
231236 suppressLogging = suppressLoggingCallback ( logContext ) ;
232237 }
233238
0 commit comments