faultMessage.setBody(null); // Reset it since we are handling it.
if (faultBody instanceof Throwable) {
exchange.setException((Throwable)faultBody);
} else {
if (exchange.getException() == null) {
exchange.setException(new CamelException("Message contains fault of type "
+ faultBody.getClass().getName() + ":\n" + faultBody));
}
}
}
}
callback.done(doneSynchronously);
}
});
}
try {
processor.process(exchange);
} catch (Throwable e) {
exchange.setException(e);
}
final Message faultMessage = exchange.getFault(false);
if (faultMessage != null) {
final Object faultBody = faultMessage.getBody();
if (faultBody != null) {
faultMessage.setBody(null); // Reset it since we are handling it.
if (faultBody instanceof Throwable) {
exchange.setException((Throwable)faultBody);
} else {
if (exchange.getException() == null) {
exchange.setException(new CamelException("Message contains fault of type "
+ faultBody.getClass().getName() + ":\n" + faultBody));
}
}
}
}