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 toCombineErrorHandler.ErrorHandlingException
and thrown by the handle method- Since:
- 1.19.0
- Author:
- lanwen (Merkushev Kirill)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CombineErrorHandler.ErrorHandlingException
Wrapper for the not handled by this handler exceptions
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CombineErrorHandler
errorHandling()
Static factory to produce new instance of this handlerboolean
handle(Exception e, Run<?,?> run, TaskListener listener)
Handles exception with help of other handlers.CombineErrorHandler
withHandlers(List<? extends ErrorHandler> handlers)
-
-
-
Method Detail
-
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 interfaceErrorHandler
- Parameters:
e
- exception to handle (log, ignore, process, rethrow)run
- run object from the steplistener
- listener object from the step- Returns:
- true if exception handled or rethrows it
-
-