Share via


TaskFailedException Class

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.lang.RuntimeException
          • com.microsoft.durabletask.TaskFailedException

public class TaskFailedException
extends java.lang.RuntimeException

Exception that gets thrown when awaiting a Task<V> for an activity or sub-orchestration that fails with an unhandled exception.

Detailed information associated with a particular task failure can be retrieved using the getErrorDetails() method.

Method Summary

Modifier and Type Method and Description
FailureDetails getErrorDetails()

Gets the details of the task failure, including exception information.

int getTaskId()

Gets the ID of the failed task.

java.lang.String getTaskName()

Gets the name of the failed task.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Methods inherited from java.lang.Throwable

java.lang.Throwable.addSuppressed java.lang.Throwable.fillInStackTrace java.lang.Throwable.getCause java.lang.Throwable.getLocalizedMessage java.lang.Throwable.getMessage java.lang.Throwable.getStackTrace java.lang.Throwable.getSuppressed java.lang.Throwable.initCause java.lang.Throwable.printStackTrace java.lang.Throwable.printStackTrace java.lang.Throwable.printStackTrace java.lang.Throwable.setStackTrace java.lang.Throwable.toString

Method Details

getErrorDetails

public FailureDetails getErrorDetails()

Gets the details of the task failure, including exception information.

Returns:

the details of the task failure

getTaskId

public int getTaskId()

Gets the ID of the failed task.

Each durable task (activities, timers, sub-orchestrations, etc.) scheduled by a task orchestrator has an auto-incrementing ID associated with it. This ID is used to distinguish tasks from one another, even if, for example, they are tasks that call the same activity. This ID can therefore be used to more easily correlate a specific task failure to a specific task.

Returns:

the ID of the failed task

getTaskName

public String getTaskName()

Gets the name of the failed task.

Returns:

the name of the failed task

Applies to