Class NamedProviderGetException
Object
Throwable
Exception
AnchorCheckedException
AnchorCombinableException
NamedProviderGetException
- All Implemented Interfaces:
Serializable
When a get operation fails with a
NamedProvider
.- Author:
- Owen Feehan
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNamedProviderGetException
(String key, Throwable cause) Create with a particular cause. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canExceptionBeCombined
(Throwable exception) Can another exception be combined with this exception?protected boolean
canExceptionBeSkipped
(Throwable exception) Can another exception be skipped, when we combine with the current exception?protected String
createMessageForDescription
(String description) Creates a message for the exception from the description.static NamedProviderGetException
nonExistingItem
(String key) Creates using a standard-error message for a non-existing itemstatic NamedProviderGetException
nonExistingItem
(String key, String providerName) LikenonExistingItem(String)
but with a message that also includes a user-friendly-name for theNamedProvider
.Creates a new {link Throwable} that summarizes this exception and any nested causes of the exception.Methods inherited from class org.anchoranalysis.core.exception.combinable.AnchorCombinableException
combineDescriptionsRecursively, findMostDeepCombinableException, getDescription, hasNoCombinableNestedExceptions
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
NamedProviderGetException
Create with a particular cause.- Parameters:
key
- the key used for the get query, which caused this exception to be thrown.cause
- the cause
-
-
Method Details
-
nonExistingItem
Creates using a standard-error message for a non-existing item- Parameters:
key
- the key used for the get query, which caused this exception to be thrown.- Returns:
- a newly created exception, with a
GetOperationFailedException
as cause.
-
nonExistingItem
LikenonExistingItem(String)
but with a message that also includes a user-friendly-name for theNamedProvider
.- Parameters:
key
- the key used for the get query, which caused this exception to be thrown.providerName
- user-friendly name for theNamedProvider
that caused this exception to be thrown.- Returns:
- a newly created exception, with a
GetOperationFailedException
as cause.
-
canExceptionBeCombined
Description copied from class:AnchorCombinableException
Can another exception be combined with this exception?- Specified by:
canExceptionBeCombined
in classAnchorCombinableException
- Parameters:
exception
- the other exception to check if it can be combined.- Returns:
- true iff this exception is compatible to be combined with the current exception.
-
canExceptionBeSkipped
Description copied from class:AnchorCombinableException
Can another exception be skipped, when we combine with the current exception?- Specified by:
canExceptionBeSkipped
in classAnchorCombinableException
- Parameters:
exception
- the other exception to check if it can be skipped.- Returns:
- true iff this exception is compatible to be skipped, when processing the current exception.
-
summarize
Description copied from class:AnchorCombinableException
Creates a new {link Throwable} that summarizes this exception and any nested causes of the exception.This can effectively combine a chain of nested exceptions into a single exception without a cause.
- Specified by:
summarize
in classAnchorCombinableException
- Returns:
- an exception summarizing the current exception, and any causes.
-
createMessageForDescription
Description copied from class:AnchorCombinableException
Creates a message for the exception from the description.- Specified by:
createMessageForDescription
in classAnchorCombinableException
- Parameters:
description
- either a single description, or a combined description- Returns:
- a message describing an error, incorporating description
-