code: public static DelegatingErrorHandlingRunnable decorateTaskWithErrorHandler(Runnable task,
              ErrorHandler errorHandler, boolean isRepeatingTask) {
          if (task instanceof DelegatingErrorHandlingRunnable) {
              return (DelegatingErrorHandlingRunnable) task;
          }
          ErrorHandler eh = errorHandler != null ? errorHandler : getDefaultErrorHandler(isRepeatingTask);
          return new DelegatingErrorHandlingRunnable(task, eh);
      }
docs: Decorate the task for error handling. If the provided
  
  @param task the task
  @param errorHandler the error handler
  @param isRepeatingTask the is repeating task
  @return the delegating error handling runnable
  {@link ErrorHandler} is not {@code null}, it will be used. Otherwise,
  repeating tasks will have errors suppressed by default whereas one-shot
  tasks will have errors propagated by default since those errors may be
  expected through the returned {@link Future}. In both cases, the errors
  will be logged.