java - Using undertow handler chaining, how do I catch exceptions in an http request that was dispatched to a worker thread? -
i'm using undertow security framework handle http request. details on can seen here : http://undertow.io/undertow-docs/undertow-docs-1.3.0/index.html#security.
my handler chain uses error handler first try catch block designed catch errors during handling of http request. worked prior implementing undertow security handlers.
public void handlerequest(httpserverexchange exchange) throws exception { try { next.handlerequest(exchange); } catch ( exception e ) { //code }
it hit error handler first, go through security handlers dispatch request. reaches mylogichandler throw exception based on null parameter.
any exception thrown caught try/catch seen here : https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/server/connectors.java#l199
this throws 500 error, not want. purpose of errorhandler let me set response code based on types of errors.
is there way errorhandler catch exceptions in requests dispatched xnio worker threads?