Class DocumentStoreException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    RDBDocumentStore.UnsupportedIndexedPropertyException

    public class DocumentStoreException
    extends java.lang.RuntimeException
    DocumentStoreException is a runtime exception for DocumentStore implementations to signal unexpected problems like a communication exception.
    See Also:
    Serialized Form
    • Constructor Detail

      • DocumentStoreException

        public DocumentStoreException​(java.lang.String message)
        Creates a DocumentStoreException.Type.GENERIC DocumentStoreException with the given message.
        Parameters:
        message - the exception message.
      • DocumentStoreException

        public DocumentStoreException​(java.lang.Throwable cause)
        Creates a DocumentStoreException.Type.GENERIC DocumentStoreException with the given cause. The message of the exception is the value returned by cause.toString() if available, otherwise null.
        Parameters:
        cause - the cause or null if nonexistent or unknown.
      • DocumentStoreException

        public DocumentStoreException​(java.lang.String message,
                                      java.lang.Throwable cause)
        Creates a DocumentStoreException.Type.GENERIC DocumentStoreException with the given message and cause.
        Parameters:
        message - the exception message.
        cause - the cause or null if nonexistent or unknown.
      • DocumentStoreException

        public DocumentStoreException​(java.lang.String message,
                                      java.lang.Throwable cause,
                                      DocumentStoreException.Type type)
        Creates a DocumentStoreException with the given message, cause and type.
        Parameters:
        message - the exception message.
        cause - the cause or null if nonexistent or unknown.
        type - the type of this exception.
    • Method Detail

      • convert

        public static DocumentStoreException convert​(@NotNull
                                                     @NotNull java.lang.Throwable t)
        Converts the given Throwable into a DocumentStoreException.Type.GENERIC DocumentStoreException. If the Throwable is an instance of DocumentStoreException this method returns the given Throwable as is, otherwise it will be used as the cause of the returned DocumentStoreException. The returned DocumentStoreException will have the same message as the given Throwable.
        Parameters:
        t - a Throwable.
        Returns:
        a DocumentStoreException.Type.GENERIC DocumentStoreException.
      • convert

        public static DocumentStoreException convert​(@NotNull
                                                     @NotNull java.lang.Throwable t,
                                                     java.lang.String msg)
        Converts the given Throwable into a DocumentStoreException.Type.GENERIC DocumentStoreException. If the Throwable is an instance of DocumentStoreException this method returns the given Throwable as is, otherwise it will be used as the cause of the returned DocumentStoreException. The returned DocumentStoreException will have the given message, unless the Throwable already is a DocumentStoreException.
        Parameters:
        t - a Throwable.
        msg - a message for the DocumentStoreException.
        Returns:
        a DocumentStoreException.Type.GENERIC DocumentStoreException.
      • convert

        public static DocumentStoreException convert​(@NotNull
                                                     @NotNull java.lang.Throwable t,
                                                     java.lang.Iterable<java.lang.String> ids)
        Converts the given Throwable into a DocumentStoreException.Type.GENERIC DocumentStoreException. If the Throwable is an instance of DocumentStoreException this method returns the given Throwable as is, otherwise it will be used as the cause of the returned DocumentStoreException. The returned DocumentStoreException will have the same message as the given Throwable appended with the list of ids.
        Parameters:
        t - a Throwable.
        ids - a list of DocumentStore IDs associated with the operation that triggered this exception.
        Returns:
        a DocumentStoreException.Type.GENERIC DocumentStoreException.
      • asDocumentStoreException

        public static DocumentStoreException asDocumentStoreException​(java.lang.String message,
                                                                      java.lang.Throwable t,
                                                                      DocumentStoreException.Type type,
                                                                      java.lang.Iterable<java.lang.String> ids)
        Converts the given Throwable into a DocumentStoreException. If the Throwable is an instance of DocumentStoreException this method returns the given Throwable as is, otherwise it will be used as the cause of the returned DocumentStoreException. The ids will be appended to the given message and used for the returned DocumentStoreException.
        Parameters:
        message - a message for the DocumentStoreException.
        t - a Throwable.
        type - the type of this exception.
        ids - a list of DocumentStore IDs associated with the operation that triggered this exception.
        Returns:
        a DocumentStoreException.Type.GENERIC DocumentStoreException.