Package io.digdag.spi

Class TaskExecutionException

  • All Implemented Interfaces:
    java.io.Serializable

    public class TaskExecutionException
    extends java.lang.RuntimeException
    An 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.ConfigElement buildExceptionErrorConfig​(java.lang.String message, java.lang.Throwable ex)  
      static io.digdag.client.config.ConfigElement buildExceptionErrorConfig​(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)  
      boolean isError()  
      static TaskExecutionException ofNextPolling​(int interval, io.digdag.client.config.ConfigElement nextStateParams)  
      static TaskExecutionException ofNextPollingWithCause​(java.lang.Throwable cause, int interval, io.digdag.client.config.ConfigElement nextStateParams)  
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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)