@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;
 }