send(msg, session, dest);
done(exchange);
} else if (exchange.getStatus() == ExchangeStatus.ERROR) {
Exception error = exchange.getError();
if (error == null) {
error = new JBIException("Exchange in ERROR state, but no exception provided");
}
msg = marshaler.createError(exchange, error, session, context);
dest = getReplyDestination(exchange, error, session, context);
setCorrelationId(context.getMessage(), msg);
send(msg, session, dest);