Skip to content

Exceptions

Every @api type across all five packages that implements Throwable.

ExceptionPackageExtendsSummary
AmbiguousDefaultFactorycoreLogicExceptionTwo registered default factories are equally close to the requested type.
BypassUnavailablecoreLogicExceptionbypassFinals() cannot do what was asked of it.
CannotWirecoreInvalidArgumentExceptionwire() cannot build the subject, or cannot decide what to pass it.
ConflictingExpectationcoreLogicExceptionA when() or expect() names a call another registration already specifies, and the two would…
ContextOwnershipViolationcoreLogicExceptionConfiguration and verification belong to the context that created a double.
ForgottenDoublecoreLogicExceptionA double outlived the context that created it — almost always a double kept in a static property…
ForwardingTargetMismatchcoreInvalidArgumentExceptionThe instance offered as a forwarding target does not satisfy what the double stands in for.
InvalidCallSpecificationcoreLogicExceptionThe closure handed to when()/verify()/calls() did not describe one call the way a specification…
InvalidDefaultValuecoreRuntimeExceptionA registered default factory produced a value the contract cannot hold.
MatcherLeakedcoreLogicExceptionA matcher reached a real call instead of a specification closure.
NeverMethodCalledcoreRuntimeExceptionA method declared : never was called without an expectation that throws.
NoDefaultValuecoreRuntimeExceptionA loose understudy had to answer a call, but the declared return type has no safe default.
NothingCapturedcoreLogicExceptionCaptor::last() was read before any matched call carried a value through its capture() argument.
OriginalCallUnavailablecoreLogicExceptioncallOriginal() was asked to delegate, and there is nothing to delegate to.
OriginalReturnTypeViolationcoreRuntimeExceptionA forwarded call returned an object the double cannot stand in for.
OutcomeUnavailablecoreLogicExceptionAn invocation's outcome was read as the wrong kind: a returned value asked of a call that threw.
StrictModeViolationcoreRuntimeExceptionA strict understudy received a call no expectation matched.
UnderstudyErrorcoreImplemented by every exception this library throws, so a test can catch misuse of Understudy…
UnsupportedTargetcoreLogicExceptionThe requested target cannot be doubled, and no option would make it work without the user changing…
VerificationFailedcoreRuntimeExceptionA verification about what the code under test did (or did not) do failed.