// wrap the producer in error handler so we have fine grained error handling on
// the output side instead of the input side
// this is needed to support redelivery on that output alone and not doing redelivery
// for the entire multicast block again which will start from scratch again
RouteContext routeContext = exchange.getUnitOfWork().getRouteContext();
ErrorHandlerBuilder builder = routeContext.getRoute().getErrorHandlerBuilder();
// create error handler (create error handler directly to keep it light weight,
// instead of using ProcessorDefinition.wrapInErrorHandler)
try {
prepared = builder.createErrorHandler(routeContext, prepared);
} catch (Exception e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}
}