CancellationException

  • CancellationException signals that a task's result, like from a FutureTask, is unavailable due to cancellation.

  • It's a subclass of IllegalStateException and provides constructors to detail the cancellation reason.

  • This exception includes methods inherited from Throwable for managing stack traces, causes, and suppressed exceptions.

  • Two public constructors allow creating a CancellationException with or without a specific detail message.

public class CancellationException extends IllegalStateException

Exception indicating that the result of a value-producing task, such as a FutureTask, cannot be retrieved because the task was cancelled.

Public Constructor Summary

CancellationException()
Constructs a CancellationException with no detail message.
CancellationException(String message)
Constructs a CancellationException with the specified detail message.

Inherited Method Summary

Public Constructors

public CancellationException ()

Constructs a CancellationException with no detail message.

public CancellationException (String message)

Constructs a CancellationException with the specified detail message.

Parameters
message the detail message