Skip to content

Commit d598b86

Browse files
committed
refactor(router): simplify exception handler condition nesting
1 parent 642ccab commit d598b86

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/Routing/Router.Invoker.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,8 @@ internal bool InvokeRequestHandlerGroup ( RequestHandlerExecutionMode mode, Span
104104
}
105105
catch (Exception ex) {
106106
exception = ex;
107-
if (parentServer!.ServerConfiguration.ThrowExceptions == false) {
108-
if (CallbackErrorHandler is not null) {
109-
result = CallbackErrorHandler ( ex, context );
110-
}
107+
if (parentServer!.ServerConfiguration.ThrowExceptions == false && CallbackErrorHandler is not null) {
108+
result = CallbackErrorHandler ( ex, context );
111109
}
112110
else
113111
throw;

0 commit comments

Comments
 (0)