public class UWSException
extends java.lang.Exception
Any exception returned by a class of the UWS pattern may be associated with an HTTP error code (like: 404, 303, 500) and a UWS error type.
Any error reported with this kind of exception will (in the most of cases) interrupt a UWS action, by reporting an error related with the UWS usage.
Modifier and Type | Field and Description |
---|---|
static int |
ACCEPTED_BUT_NOT_COMPLETE |
static int |
BAD_REQUEST |
protected ErrorType |
errorType
The UWS error type (by default
FATAL ). |
static int |
FORBIDDEN |
protected int |
httpErrorCode
The HTTP error code (by default
NOT_FOUND ). |
static int |
INTERNAL_SERVER_ERROR |
static int |
NO_CONTENT |
static int |
NOT_ALLOWED |
static int |
NOT_FOUND |
static int |
NOT_IMPLEMENTED |
static int |
OK |
static int |
PERMISSION_DENIED |
static int |
REQUEST_ENTITY_TOO_LARGE |
static int |
SEE_OTHER |
static int |
SERVICE_UNAVAILABLE |
static int |
USER_ACCESS_DENIED |
Constructor and Description |
---|
UWSException(int httpError,
java.lang.String msg)
Exception that occurs in the general context of UWS and which should return the given HTTP error code.
|
UWSException(int httpError,
java.lang.String msg,
ErrorType type)
Exception that occurs in the general context of UWS, with the given type and which should return the given HTTP error code.
|
UWSException(int httpError,
java.lang.Throwable t)
Exception that occurs in the general context of UWS,
because the given exception has been thrown and that which should return the given HTTP error status.
|
UWSException(int httpError,
java.lang.Throwable t,
ErrorType type)
Exception that occurs in the general context of UWS with the given error type,
because the given exception has been thrown and that which should return the given HTTP error status.
|
UWSException(int httpError,
java.lang.Throwable t,
java.lang.String msg)
Exception that occurs in the general context of UWS,
because the given exception has been thrown and that which should return the given HTTP error status.
|
UWSException(int httpError,
java.lang.Throwable t,
java.lang.String msg,
ErrorType type)
Exception that occurs in the general context of UWS,
because the given exception has been thrown and that which should return the given HTTP error status.
|
UWSException(java.lang.String msg)
Exception in the general context of UWS.
|
UWSException(java.lang.String msg,
ErrorType type)
Exception that occurs in the general context of UWS, and with the specified error type (FATAL or TRANSIENT).
|
UWSException(java.lang.Throwable t)
Exception that occurs in the general context of UWS because the given exception has been thrown.
|
UWSException(java.lang.Throwable t,
ErrorType type)
Exception with the given type that occurs in the general context of UWS
because the given exception has been thrown.
|
Modifier and Type | Method and Description |
---|---|
int |
getHttpErrorCode()
Get the HTTP error code that should be returned.
|
ErrorType |
getUWSErrorType()
Get the type of this error (from the UWS point of view ; FATAL or TRANSIENT).
|
public static final int OK
public static final int ACCEPTED_BUT_NOT_COMPLETE
public static final int NO_CONTENT
public static final int SEE_OTHER
public static final int BAD_REQUEST
public static final int FORBIDDEN
public static final int NOT_FOUND
public static final int NOT_ALLOWED
public static final int REQUEST_ENTITY_TOO_LARGE
public static final int INTERNAL_SERVER_ERROR
public static final int NOT_IMPLEMENTED
public static final int SERVICE_UNAVAILABLE
public static final int USER_ACCESS_DENIED
public static final int PERMISSION_DENIED
protected int httpErrorCode
NOT_FOUND
). It MUST BE greater than 0.public UWSException(java.lang.String msg)
msg
- Error message to display.public UWSException(java.lang.String msg, ErrorType type)
msg
- Error message to display.type
- Type of the error (FATAL or TRANSIENT). Note: If NULL, it will be considered as FATAL.public UWSException(java.lang.Throwable t)
t
- The thrown (and so caught) exception.public UWSException(java.lang.Throwable t, ErrorType type)
t
- The thrown (and so caught) exception.type
- Type of the error (FATAL or TRANSIENT). Note: If NULL, it will be considered as FATAL.public UWSException(int httpError, java.lang.String msg)
httpError
- HTTP error code to return.msg
- Error message to display.public UWSException(int httpError, java.lang.String msg, ErrorType type)
httpError
- HTTP error code to return.msg
- Error message to display.type
- Type of the error (FATAL or TRANSIENT). Note: If NULL, it will be considered as FATAL.public UWSException(int httpError, java.lang.Throwable t)
httpError
- HTTP error code to return.t
- The thrown (and so caught) exception.public UWSException(int httpError, java.lang.Throwable t, ErrorType type)
httpError
- HTTP error code to return.t
- The thrown (and so caught) exception.type
- Type of the error (FATAL or TRANSIENT). Note: If NULL, it will be considered as FATAL.public UWSException(int httpError, java.lang.Throwable t, java.lang.String msg)
httpError
- HTTP error code to return.t
- The thrown (and so caught) exception.msg
- Error message to display.public UWSException(int httpError, java.lang.Throwable t, java.lang.String msg, ErrorType type)
httpError
- HTTP error code to return.t
- The thrown (and so caught) exception.msg
- Error message to display.type
- Type of the error (FATAL or TRANSIENT). Note: If NULL, it will be considered as FATAL.public int getHttpErrorCode()
public ErrorType getUWSErrorType()