public class DocumentStoreException
extends java.lang.RuntimeException
DocumentStoreException
is a runtime exception for
DocumentStore
implementations to signal unexpected problems like
a communication exception.Modifier and Type | Class and Description |
---|---|
static class |
DocumentStoreException.Type |
Constructor and Description |
---|
DocumentStoreException(java.lang.String message)
Creates a
DocumentStoreException.Type.GENERIC DocumentStoreException with the
given message. |
DocumentStoreException(java.lang.String message,
java.lang.Throwable cause)
Creates a
DocumentStoreException.Type.GENERIC DocumentStoreException with the
given message and cause. |
DocumentStoreException(java.lang.String message,
java.lang.Throwable cause,
DocumentStoreException.Type type)
Creates a
DocumentStoreException with the given message, cause
and type. |
DocumentStoreException(java.lang.Throwable cause)
Creates a
DocumentStoreException.Type.GENERIC DocumentStoreException with the
given cause. |
Modifier and Type | Method and Description |
---|---|
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 . |
static DocumentStoreException |
convert(@NotNull java.lang.Throwable t)
|
static DocumentStoreException |
convert(@NotNull java.lang.Throwable t,
java.lang.Iterable<java.lang.String> ids)
|
static DocumentStoreException |
convert(@NotNull java.lang.Throwable t,
java.lang.String msg)
|
DocumentStoreException.Type |
getType() |
public DocumentStoreException(java.lang.String message)
DocumentStoreException.Type.GENERIC
DocumentStoreException
with the
given message.message
- the exception message.public DocumentStoreException(java.lang.Throwable cause)
DocumentStoreException.Type.GENERIC
DocumentStoreException
with the
given cause. The message of the exception is the value returned by
cause.toString()
if available, otherwise null
.cause
- the cause or null
if nonexistent or unknown.public DocumentStoreException(java.lang.String message, java.lang.Throwable cause)
DocumentStoreException.Type.GENERIC
DocumentStoreException
with the
given message and cause.message
- the exception message.cause
- the cause or null
if nonexistent or unknown.public DocumentStoreException(java.lang.String message, java.lang.Throwable cause, DocumentStoreException.Type type)
DocumentStoreException
with the given message, cause
and type.message
- the exception message.cause
- the cause or null
if nonexistent or unknown.type
- the type of this exception.public static DocumentStoreException convert(@NotNull @NotNull java.lang.Throwable t)
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
.t
- a Throwable
.DocumentStoreException.Type.GENERIC
DocumentStoreException.public static DocumentStoreException convert(@NotNull @NotNull java.lang.Throwable t, java.lang.String msg)
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
.t
- a Throwable
.msg
- a message for the DocumentStoreException
.DocumentStoreException.Type.GENERIC
DocumentStoreException.public static DocumentStoreException convert(@NotNull @NotNull java.lang.Throwable t, java.lang.Iterable<java.lang.String> ids)
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
.t
- a Throwable
.ids
- a list of DocumentStore
IDs associated with the
operation that triggered this exception.DocumentStoreException.Type.GENERIC
DocumentStoreException.public static DocumentStoreException asDocumentStoreException(java.lang.String message, java.lang.Throwable t, DocumentStoreException.Type type, java.lang.Iterable<java.lang.String> ids)
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
.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.DocumentStoreException.Type.GENERIC
DocumentStoreException.public DocumentStoreException.Type getType()
Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.