// START SNIPPET: e2
private class MyErrorProcessor implements Processor {
public void process(Exchange exchange) throws Exception {
// cast to TraceableUnitOfWork so we can work on the intercepted node path
TraceableUnitOfWork tuow = (TraceableUnitOfWork) exchange.getUnitOfWork();
// get the list of intercepted nodes
List<ProcessorDefinition> list = tuow.getInterceptedNodes();
// get the 2nd last as the last is me (MyErrorProcessor)
ProcessorDefinition last = list.get(list.size() - 2);
// set error message
exchange.getFault().setBody("Failed at: " + last.getLabel());