Class DocumentStoreException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.apache.jackrabbit.oak.plugins.document.DocumentStoreException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
RDBDocumentStore.UnsupportedIndexedPropertyException
public class DocumentStoreException extends RuntimeException
DocumentStoreException
is a runtime exception forDocumentStore
implementations to signal unexpected problems like a communication exception.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DocumentStoreException.Type
-
Constructor Summary
Constructors Constructor Description DocumentStoreException(String message)
Creates aDocumentStoreException.Type.GENERIC
DocumentStoreException
with the given message.DocumentStoreException(String message, Throwable cause)
Creates aDocumentStoreException.Type.GENERIC
DocumentStoreException
with the given message and cause.DocumentStoreException(String message, Throwable cause, DocumentStoreException.Type type)
Creates aDocumentStoreException
with the given message, cause and type.DocumentStoreException(Throwable cause)
Creates aDocumentStoreException.Type.GENERIC
DocumentStoreException
with the given cause.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DocumentStoreException
asDocumentStoreException(String message, Throwable t, DocumentStoreException.Type type, Iterable<String> ids)
Converts the givenThrowable
into aDocumentStoreException
.static DocumentStoreException
convert(@NotNull Throwable t)
static DocumentStoreException
convert(@NotNull Throwable t, Iterable<String> ids)
static DocumentStoreException
convert(@NotNull Throwable t, String msg)
DocumentStoreException.Type
getType()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
DocumentStoreException
public DocumentStoreException(String message)
Creates aDocumentStoreException.Type.GENERIC
DocumentStoreException
with the given message.- Parameters:
message
- the exception message.
-
DocumentStoreException
public DocumentStoreException(Throwable cause)
Creates aDocumentStoreException.Type.GENERIC
DocumentStoreException
with the given cause. The message of the exception is the value returned bycause.toString()
if available, otherwisenull
.- Parameters:
cause
- the cause ornull
if nonexistent or unknown.
-
DocumentStoreException
public DocumentStoreException(String message, Throwable cause)
Creates aDocumentStoreException.Type.GENERIC
DocumentStoreException
with the given message and cause.- Parameters:
message
- the exception message.cause
- the cause ornull
if nonexistent or unknown.
-
DocumentStoreException
public DocumentStoreException(String message, Throwable cause, DocumentStoreException.Type type)
Creates aDocumentStoreException
with the given message, cause and type.- Parameters:
message
- the exception message.cause
- the cause ornull
if nonexistent or unknown.type
- the type of this exception.
-
-
Method Detail
-
convert
public static DocumentStoreException convert(@NotNull @NotNull Throwable t)
Converts the givenThrowable
into aDocumentStoreException.Type.GENERIC
DocumentStoreException
. If theThrowable
is an instance ofDocumentStoreException
this method returns the givenThrowable
as is, otherwise it will be used as the cause of the returnedDocumentStoreException
. The returnedDocumentStoreException
will have the same message as the givenThrowable
.- Parameters:
t
- aThrowable
.- Returns:
- a
DocumentStoreException.Type.GENERIC
DocumentStoreException.
-
convert
public static DocumentStoreException convert(@NotNull @NotNull Throwable t, String msg)
Converts the givenThrowable
into aDocumentStoreException.Type.GENERIC
DocumentStoreException
. If theThrowable
is an instance ofDocumentStoreException
this method returns the givenThrowable
as is, otherwise it will be used as the cause of the returnedDocumentStoreException
. The returnedDocumentStoreException
will have the given message, unless theThrowable
already is aDocumentStoreException
.- Parameters:
t
- aThrowable
.msg
- a message for theDocumentStoreException
.- Returns:
- a
DocumentStoreException.Type.GENERIC
DocumentStoreException.
-
convert
public static DocumentStoreException convert(@NotNull @NotNull Throwable t, Iterable<String> ids)
Converts the givenThrowable
into aDocumentStoreException.Type.GENERIC
DocumentStoreException
. If theThrowable
is an instance ofDocumentStoreException
this method returns the givenThrowable
as is, otherwise it will be used as the cause of the returnedDocumentStoreException
. The returnedDocumentStoreException
will have the same message as the givenThrowable
appended with the list ofids
.- Parameters:
t
- aThrowable
.ids
- a list ofDocumentStore
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 givenThrowable
into aDocumentStoreException
. If theThrowable
is an instance ofDocumentStoreException
this method returns the givenThrowable
as is, otherwise it will be used as the cause of the returnedDocumentStoreException
. Theids
will be appended to the givenmessage
and used for the returnedDocumentStoreException
.- Parameters:
message
- a message for theDocumentStoreException
.t
- aThrowable
.type
- the type of this exception.ids
- a list ofDocumentStore
IDs associated with the operation that triggered this exception.- Returns:
- a
DocumentStoreException.Type.GENERIC
DocumentStoreException.
-
getType
public DocumentStoreException.Type getType()
- Returns:
- the type of this exception.
-
-