Package io.digdag.spi
Class TaskExecutionException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.digdag.spi.TaskExecutionException
-
- All Implemented Interfaces:
java.io.Serializable
public class TaskExecutionException extends java.lang.RuntimeExceptionAn exception thrown when an expected exception happens.When an error happens in an operator, it should be wrapped with TaskExecutionException if the cause is expected so that Digdag shows a message for users without verbose stacktrace. The other exception classes are regarded as unexpected and Digdag shows stacktrace for operator developers.
TaskExecutionException is also used to let Digdag retry the task later. Use ofNextPolling (if task retries for simple polling) or ofNextPollingWithCause (if task retries to recover from an error) method to retry.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TaskExecutionException(java.lang.String message)Build an expected exception with a simple message to make the task failed.TaskExecutionException(java.lang.String message, io.digdag.client.config.ConfigElement error)Deprecated.TaskExecutionException(java.lang.String customMessage, java.lang.Throwable cause)Wrap an expected exception with a custom well-formatted message to make the task failed.TaskExecutionException(java.lang.String message, java.util.Map<java.lang.String,java.lang.String> errorProperties)Build an expected exception with a simple message and properties to make the task failed.TaskExecutionException(java.lang.Throwable cause)Wrap an expected exception to make the task failed.TaskExecutionException(java.lang.Throwable cause, io.digdag.client.config.ConfigElement error)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static io.digdag.client.config.ConfigElementbuildExceptionErrorConfig(java.lang.String message, java.lang.Throwable ex)static io.digdag.client.config.ConfigElementbuildExceptionErrorConfig(java.lang.Throwable ex)com.google.common.base.Optional<io.digdag.client.config.Config>getError(io.digdag.client.config.ConfigFactory cf)com.google.common.base.Optional<java.lang.Integer>getRetryInterval()com.google.common.base.Optional<io.digdag.client.config.Config>getStateParams(io.digdag.client.config.ConfigFactory cf)booleanisError()static TaskExecutionExceptionofNextPolling(int interval, io.digdag.client.config.ConfigElement nextStateParams)static TaskExecutionExceptionofNextPollingWithCause(java.lang.Throwable cause, int interval, io.digdag.client.config.ConfigElement nextStateParams)
-
-
-
Constructor Detail
-
TaskExecutionException
public TaskExecutionException(java.lang.Throwable cause)
Wrap an expected exception to make the task failed.
-
TaskExecutionException
public TaskExecutionException(java.lang.String customMessage, java.lang.Throwable cause)Wrap an expected exception with a custom well-formatted message to make the task failed.
-
TaskExecutionException
public TaskExecutionException(java.lang.String message)
Build an expected exception with a simple message to make the task failed.
-
TaskExecutionException
public TaskExecutionException(java.lang.String message, java.util.Map<java.lang.String,java.lang.String> errorProperties)Build an expected exception with a simple message and properties to make the task failed.
-
TaskExecutionException
@Deprecated public TaskExecutionException(java.lang.String message, io.digdag.client.config.ConfigElement error)Deprecated.
-
TaskExecutionException
@Deprecated public TaskExecutionException(java.lang.Throwable cause, io.digdag.client.config.ConfigElement error)Deprecated.
-
-
Method Detail
-
buildExceptionErrorConfig
public static io.digdag.client.config.ConfigElement buildExceptionErrorConfig(java.lang.Throwable ex)
-
buildExceptionErrorConfig
public static io.digdag.client.config.ConfigElement buildExceptionErrorConfig(java.lang.String message, java.lang.Throwable ex)
-
ofNextPolling
public static TaskExecutionException ofNextPolling(int interval, io.digdag.client.config.ConfigElement nextStateParams)
-
ofNextPollingWithCause
public static TaskExecutionException ofNextPollingWithCause(java.lang.Throwable cause, int interval, io.digdag.client.config.ConfigElement nextStateParams)
-
getError
public com.google.common.base.Optional<io.digdag.client.config.Config> getError(io.digdag.client.config.ConfigFactory cf)
-
isError
public boolean isError()
-
getRetryInterval
public com.google.common.base.Optional<java.lang.Integer> getRetryInterval()
-
getStateParams
public com.google.common.base.Optional<io.digdag.client.config.Config> getStateParams(io.digdag.client.config.ConfigFactory cf)
-
-