Class UncheckedExecutionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.google.common.util.concurrent.UncheckedExecutionException
- All Implemented Interfaces:
Serializable
Unchecked variant of
ExecutionException
. As with
ExecutionException
, the exception's cause comes from a failed task,
possibly run in another thread.
UncheckedExecutionException
is intended as an alternative to
ExecutionException
when the exception thrown by a task is an unchecked exception. However, it
may also wrap a checked exception in some cases.
When wrapping an Error
from another thread, prefer ExecutionError
. When
wrapping a checked exception, prefer ExecutionException
.
- Since:
- 10.0
- Author:
- Charles Fry
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
Deprecated.Prefer UncheckedExecutionException(java.lang.@org.jspecify.annotations.Nullable Throwable) a constructor that accepts a cause: Users of this class typically expect for instances to have a non-null cause.protected
UncheckedExecutionException
(@Nullable String message) Deprecated.Prefer UncheckedExecutionException(java.lang.@org.jspecify.annotations.Nullable String,java.lang.@org.jspecify.annotations.Nullable Throwable) a constructor that accepts a cause: Users of this class typically expect for instances to have a non-null cause.UncheckedExecutionException
(@Nullable String message, @Nullable Throwable cause) Creates a new instance with the given detail message and cause.Creates a new instance withnull
as its detail message and the given cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UncheckedExecutionException
Deprecated.Prefer UncheckedExecutionException(java.lang.@org.jspecify.annotations.Nullable Throwable) a constructor that accepts a cause: Users of this class typically expect for instances to have a non-null cause. At the moment, you can usually still preserve behavior by passing an explicitnull
cause. Note, however, that passing an explicitnull
cause prevents anyone from callingThrowable.initCause(java.lang.Throwable)
later, so it is not quite equivalent to using a constructor that omits the cause.Creates a new instance withnull
as its detail message and no cause. -
UncheckedExecutionException
Deprecated.Prefer UncheckedExecutionException(java.lang.@org.jspecify.annotations.Nullable String,java.lang.@org.jspecify.annotations.Nullable Throwable) a constructor that accepts a cause: Users of this class typically expect for instances to have a non-null cause. At the moment, you can usually still preserve behavior by passing an explicitnull
cause. Note, however, that passing an explicitnull
cause prevents anyone from callingThrowable.initCause(java.lang.Throwable)
later, so it is not quite equivalent to using a constructor that omits the cause.Creates a new instance with the given detail message and no cause. -
UncheckedExecutionException
Creates a new instance with the given detail message and cause. Prefer to provide a non-nullablecause
, as many users expect to find one. -
UncheckedExecutionException
Creates a new instance withnull
as its detail message and the given cause. Prefer to provide a non-nullablecause
, as many users expect to find one.
-