Class CDORestException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.eclipse.emf.cdo.server.rest.CDORestException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CDORestAuthenticationException
Represents a safe REST problem that can be translated into an HTTP status and an RFC 9457 response body.
The status and problem code are part of the client-visible REST contract. The message is also sent to the caller and must therefore be written for clients; it must not contain stack traces, internal paths, credentials, or other implementation details. This exception is used by the REST service and may also be used by transport-neutral REST extensions that need to return a specific safe problem.
- Author:
- Eike Stepper
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCDORestException(int status, String code, String message) Creates a REST problem with an HTTP status, stable machine-readable code, and client-visible message. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CDORestException
Creates a REST problem with an HTTP status, stable machine-readable code, and client-visible message.- Parameters:
status- an HTTP error status from 400 through 599code- a non-empty machine-readable problem code containing lowercase ASCII letters, digits, or hyphensmessage- a safe explanation suitable for transmission to an HTTP caller- Throws:
IllegalArgumentException- if the status or code is invalidNullPointerException- if the code or message isnull
-
-
Method Details
-
getStatus
public int getStatus()Returns the HTTP status code associated with this problem.- Returns:
- the HTTP status code
-
getCode
-