Class NamedProviderGetException

All Implemented Interfaces:
Serializable

public class NamedProviderGetException extends AnchorCombinableException
When a get operation fails with a NamedProvider.
Author:
Owen Feehan
See Also:
  • Constructor Details

    • NamedProviderGetException

      public NamedProviderGetException(String key, Throwable cause)
      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

      public static NamedProviderGetException nonExistingItem(String key)
      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

      public static NamedProviderGetException nonExistingItem(String key, String providerName)
      Like nonExistingItem(String) but with a message that also includes a user-friendly-name for the NamedProvider.
      Parameters:
      key - the key used for the get query, which caused this exception to be thrown.
      providerName - user-friendly name for the NamedProvider that caused this exception to be thrown.
      Returns:
      a newly created exception, with a GetOperationFailedException as cause.
    • canExceptionBeCombined

      protected boolean canExceptionBeCombined(Throwable exception)
      Description copied from class: AnchorCombinableException
      Can another exception be combined with this exception?
      Specified by:
      canExceptionBeCombined in class AnchorCombinableException
      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

      protected boolean canExceptionBeSkipped(Throwable exception)
      Description copied from class: AnchorCombinableException
      Can another exception be skipped, when we combine with the current exception?
      Specified by:
      canExceptionBeSkipped in class AnchorCombinableException
      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

      public Throwable 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 class AnchorCombinableException
      Returns:
      an exception summarizing the current exception, and any causes.
    • createMessageForDescription

      protected String createMessageForDescription(String description)
      Description copied from class: AnchorCombinableException
      Creates a message for the exception from the description.
      Specified by:
      createMessageForDescription in class AnchorCombinableException
      Parameters:
      description - either a single description, or a combined description
      Returns:
      a message describing an error, incorporating description