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 booleancanExceptionBeCombined(Throwable exception) Can another exception be combined with this exception?protected booleancanExceptionBeSkipped(Throwable exception) Can another exception be skipped, when we combine with the current exception?protected StringcreateMessageForDescription(String description) Creates a message for the exception from the description.static NamedProviderGetExceptionnonExistingItem(String key) Creates using a standard-error message for a non-existing itemstatic NamedProviderGetExceptionnonExistingItem(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, hasNoCombinableNestedExceptionsMethods 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
GetOperationFailedExceptionas 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 theNamedProviderthat caused this exception to be thrown.- Returns:
- a newly created exception, with a
GetOperationFailedExceptionas cause.
-
canExceptionBeCombined
Description copied from class:AnchorCombinableExceptionCan another exception be combined with this exception?- Specified by:
canExceptionBeCombinedin 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:AnchorCombinableExceptionCan another exception be skipped, when we combine with the current exception?- Specified by:
canExceptionBeSkippedin 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:AnchorCombinableExceptionCreates 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:
summarizein classAnchorCombinableException- Returns:
- an exception summarizing the current exception, and any causes.
-
createMessageForDescription
Description copied from class:AnchorCombinableExceptionCreates a message for the exception from the description.- Specified by:
createMessageForDescriptionin classAnchorCombinableException- Parameters:
description- either a single description, or a combined description- Returns:
- a message describing an error, incorporating description
-