Class DocumentStoreException

    • Constructor Detail

      • DocumentStoreException

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

        public DocumentStoreException​(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​(String message,
                                      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​(String message,
                                      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 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 Throwable t,
                                                     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 Throwable t,
                                                     Iterable<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​(String message,
                                                                      Throwable t,
                                                                      DocumentStoreException.Type type,
                                                                      Iterable<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.