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
DocumentStoreException
is a runtime exception for
DocumentStore
implementations to signal unexpected problems like
a communication exception.- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDocumentStoreException
(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
Modifier and TypeMethodDescriptionstatic DocumentStoreException
asDocumentStoreException
(String message, Throwable t, DocumentStoreException.Type type, Iterable<String> ids) Converts the givenThrowable
into aDocumentStoreException
.static DocumentStoreException
static DocumentStoreException
static DocumentStoreException
getType()
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
DocumentStoreException
Creates aDocumentStoreException.Type.GENERIC
DocumentStoreException
with the given message.- Parameters:
message
- the exception message.
-
DocumentStoreException
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
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
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 Details
-
convert
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
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
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
- Returns:
- the type of this exception.
-