@Override
 public ErrorHandlerBuilder getObject() throws Exception {
   ErrorHandlerBuilder errorHandler = getObjectType().newInstance();
   if (errorHandler instanceof DefaultErrorHandlerBuilder) {
     DefaultErrorHandlerBuilder handler = (DefaultErrorHandlerBuilder) errorHandler;
     if (deadLetterUri != null) {
       handler.setDeadLetterUri(deadLetterUri);
     }
     if (deadLetterHandleNewException != null) {
       handler.setDeadLetterHandleNewException(deadLetterHandleNewException);
     }
     if (useOriginalMessage != null) {
       handler.setUseOriginalMessage(useOriginalMessage);
     }
     if (redeliveryPolicy != null) {
       handler.setRedeliveryPolicy(
           redeliveryPolicy.createRedeliveryPolicy(getCamelContext(), null));
     }
     if (redeliveryPolicyRef != null) {
       handler.setRedeliveryPolicy(lookup(redeliveryPolicyRef, RedeliveryPolicy.class));
     }
     if (onRedeliveryRef != null) {
       handler.setOnRedelivery(lookup(onRedeliveryRef, Processor.class));
     }
     if (onPrepareFailureRef != null) {
       handler.setOnPrepareFailure(lookup(onPrepareFailureRef, Processor.class));
     }
     if (onExceptionOccurredRef != null) {
       handler.setOnExceptionOccurred(lookup(onExceptionOccurredRef, Processor.class));
     }
     if (retryWhileRef != null) {
       handler.setRetryWhileRef(retryWhileRef);
     }
     if (executorServiceRef != null) {
       handler.setExecutorServiceRef(executorServiceRef);
     }
   } else if (errorHandler instanceof LoggingErrorHandlerBuilder) {
     LoggingErrorHandlerBuilder handler = (LoggingErrorHandlerBuilder) errorHandler;
     if (level != null) {
       handler.setLevel(level);
     }
     if (logName != null) {
       handler.setLogName(logName);
     }
   }
   return errorHandler;
 }
 /**
  * Sets a processor that should be processed <b>before</b> a redelivery attempt.
  *
  * <p>Can be used to change the {@link org.apache.camel.Exchange} <b>before</b> its being
  * redelivered.
  *
  * @param processor the processor
  * @return the builder
  */
 public DefaultErrorHandlerBuilder onRedelivery(Processor processor) {
   setOnRedelivery(processor);
   return this;
 }