<div dir="ltr"><span style="font-size:12.8px">I have a pretty basic server set up:</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">ExceptionHandler -&gt; Security Handlers * -&gt; PathTemplateHandler -&gt; my routes</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">* The security handlers are set up as shown in the examples [1] and I&#39;m also using the same `IdentityManager` for my tinkering.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">What I&#39;m seeing is that in ExceptionHandler [2] the request is just passed directly onto the next handler, which in this case, is the start of the security handlers.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">The request is passed through each handler until it hits `AuthenticationCallHandler` and is moved off the IO thread [3]. The call then returns, and all the invocations to the next handler finish back up the stack until `ExceptionHandler`, where the call completes successfully.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Trouble is, the request was malformed and the route handling it threw an exception and it wasn&#39;t handled as expected.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I guess the correct answer is that I shouldn&#39;t have allowed it to get thrown out of the handler for the route; catch it there and send the expected error response.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">But, I&#39;m curious if there was a way to do this with the handlers, or perhaps, more generally, what are the expectations along the call chain of handlers when some may move off the initial IO thread.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Mike </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">[1] <a href="https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/security/basic/BasicAuthServer.java" target="_blank">https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/security/basic/BasicAuthServer.java</a></div><div style="font-size:12.8px">[2] <a href="https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/server/handlers/ExceptionHandler.java#L29" target="_blank">https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/server/handlers/ExceptionHandler.java#L29</a></div><div style="font-size:12.8px">[3] <a href="https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/security/handlers/AuthenticationCallHandler.java#L45-L48" target="_blank">https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/security/handlers/AuthenticationCallHandler.java#L45-L48</a></div></div>