public abstract class BucketStorageException extends java.lang.Exception implements HttpErrorCodeProvider
Throwables
that indicate an illegal
condition occurred while operating with buckets.ERROR_CODE_CONFLICT, ERROR_CODE_INTERNAL_ERROR, ERROR_CODE_NOT_FOUND, ERROR_CODE_NOT_SET
Constructor and Description |
---|
BucketStorageException(BucketErrorCode errorCode)
Constructs a new exception with
null as its detail message. |
BucketStorageException(BucketErrorCode errorCode,
java.lang.String message)
Constructs a new exception with the specified detail message.
|
BucketStorageException(BucketErrorCode errorCode,
java.lang.String message,
java.lang.Throwable cause)
Constructs a new exception with the specified detail message and
cause.
|
BucketStorageException(BucketErrorCode errorCode,
java.lang.Throwable cause)
Constructs a new exception with the specified cause and a detail
message of (cause==null ?
|
Modifier and Type | Method and Description |
---|---|
BucketErrorCode |
getErrorCode()
Returns the bucket error code associated with this exception.
|
int |
getHttpErrorCode()
Returns a HTTP error code to be returned to the HTTP client.
|
boolean |
isHttpErrorCodeSet()
Returns true, if the HTTP code was set, false otherwise.
|
void |
setHttpErrorCode(int httpErrorCode)
Sets a new HTTP code to be later returned by this provider.
|
public BucketStorageException(BucketErrorCode errorCode)
null
as its detail message.
The cause is not initialized, and may subsequently be initialized by a
call to Throwable.initCause(java.lang.Throwable)
.errorCode
- the bucket error code associated with this exceptionpublic BucketStorageException(BucketErrorCode errorCode, java.lang.String message)
Throwable.initCause(java.lang.Throwable)
.errorCode
- the bucket error code associated with this exceptionmessage
- the detail message. The detail message is saved for
later retrieval by the Throwable.getMessage()
method.public BucketStorageException(BucketErrorCode errorCode, java.lang.String message, java.lang.Throwable cause)
Note that the detail message associated with
cause
is not automatically incorporated in
this exception's detail message.
errorCode
- the bucket error code associated with this exceptionmessage
- the detail message (which is saved for later retrieval
by the Throwable.getMessage()
method).cause
- the cause (which is saved for later retrieval by the
Throwable.getCause()
method). (A null value is
permitted, and indicates that the cause is nonexistent or
unknown.)public BucketStorageException(BucketErrorCode errorCode, java.lang.Throwable cause)
errorCode
- the bucket error code associated with this exceptioncause
- the cause (which is saved for later retrieval by the
Throwable.getCause()
method). (A null value is
permitted, and indicates that the cause is nonexistent or
unknown.)public BucketErrorCode getErrorCode()
public boolean isHttpErrorCodeSet()
HttpErrorCodeProvider
isHttpErrorCodeSet
in interface HttpErrorCodeProvider
public int getHttpErrorCode()
HttpErrorCodeProvider
getHttpErrorCode
in interface HttpErrorCodeProvider
public void setHttpErrorCode(int httpErrorCode)
httpErrorCode
- a new HTTP code to be later returned by this provider.