* Initializes the Error Handlers Chain (the chain that handles the
* exceptions). Usually the user won't need to override this method, but
* <tt>initErrorUserHandlers</tt> instead.
*/
protected ResponseHandlersChain initErrorHandlersChain() {
ResponseHandlersChain handlersChain = new ResponseHandlersChain();
Responses responsesHandler = createHandler(Responses.class);
responsesHandler.setIsErrorFlow(true);
handlersChain.addHandler(responsesHandler);
handlersChain.addHandler(createHandler(PopulateErrorResponseHandler.class));
handlersChain.addHandler(createHandler(PopulateResponseStatusHandler.class));
PopulateResponseMediaTypeHandler populateMediaTypeHandler =
createHandler(PopulateResponseMediaTypeHandler.class);
populateMediaTypeHandler.setErrorFlow(true);
handlersChain.addHandler(populateMediaTypeHandler);
if (errorUserHandlers != null) {
for (ResponseHandler h : errorUserHandlers) {
h.init(properties);
handlersChain.addHandler(h);
}
}
handlersChain.addHandler(createHandler(FlushResultHandler.class));
logger.trace("Error handlers chain is: {}", handlersChain); //$NON-NLS-1$
return handlersChain;
}