Class CombineErrorHandler

java.lang.Object
org.jenkinsci.plugins.github.common.CombineErrorHandler
All Implemented Interfaces:
ErrorHandler

public class CombineErrorHandler extends Object implements ErrorHandler
With help of list of other error handlers handles exception. If no one will handle it, exception will be wrapped to CombineErrorHandler.ErrorHandlingException and thrown by the handle method
Since:
1.19.0
Author:
lanwen (Merkushev Kirill)
  • Method Details

    • errorHandling

      public static CombineErrorHandler errorHandling()
      Static factory to produce new instance of this handler
      Returns:
      new instance
    • withHandlers

      public CombineErrorHandler withHandlers(List<? extends ErrorHandler> handlers)
    • handle

      public boolean handle(Exception e, @NonNull Run<?,?> run, @NonNull TaskListener listener)
      Handles exception with help of other handlers. If no one will handle it, it will be thrown to the top level
      Specified by:
      handle in interface ErrorHandler
      Parameters:
      e - exception to handle (log, ignore, process, rethrow)
      run - run object from the step
      listener - listener object from the step
      Returns:
      true if exception handled or rethrows it