Package org.apache.juneau.objecttools
Class ObjectRestException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.juneau.BasicRuntimeException
org.apache.juneau.objecttools.ObjectRestException
- All Implemented Interfaces:
Serializable
Generic exception thrown from the
ObjectRest class.
Typically, this is a user-error, such as trying to address a non-existent node in the tree.
The status code is an HTTP-equivalent code. It will be one of the following:
-
HTTP_BAD_REQUEST- Attempting to do something impossible. -
HTTP_NOT_FOUND- Attempting to access a non-existent node in the tree. -
HTTP_FORBIDDEN- Attempting to overwrite the root object.
-
Constructor Summary
ConstructorsConstructorDescriptionObjectRestException(int status, String message, Object... args) Constructor.ObjectRestException(Throwable cause, int status, String message, Object... args) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintThe HTTP-equivalent status code.setMessage(String message, Object... args) Sets the detail message on this exception.Methods inherited from class org.apache.juneau.BasicRuntimeException
getMessageMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ObjectRestException
Constructor.- Parameters:
status- The HTTP-equivalent status code.message- The detailed message.args- OptionalMessageFormat-style arguments.
-
ObjectRestException
Constructor.- Parameters:
cause- The cause of this exception.status- HTTP status code.message- TheMessageFormat-style message.args- OptionalMessageFormat-style arguments.
-
-
Method Details
-
getStatus
The HTTP-equivalent status code.See above for details.
- Returns:
- The HTTP-equivalent status code.
-
setMessage
Description copied from class:BasicRuntimeExceptionSets the detail message on this exception.- Overrides:
setMessagein classBasicRuntimeException- Parameters:
message- The message.args- The message args.- Returns:
- This object.
-