@Deprecated public class RestException extends RuntimeException
HttpException
REST methods on subclasses of RestServlet
can throw this exception to trigger an HTTP status other than the
automatically-generated
Constructor and Description |
---|
RestException(int status,
String msg,
Object... args)
Deprecated.
Constructor.
|
RestException(String msg)
Deprecated.
Constructor.
|
RestException(Throwable cause,
int status)
Deprecated.
Constructor.
|
RestException(Throwable cause,
int status,
String msg,
Object... args)
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getFullStackMessage(boolean scrubForXssVulnerabilities)
Deprecated.
Returns all error messages from all errors in this stack.
|
int |
getOccurrence()
Deprecated.
|
Throwable |
getRootCause()
Deprecated.
Returns the root cause of this exception.
|
int |
getStatus()
Deprecated.
Returns the HTTP status code.
|
int |
hashCode()
Deprecated.
|
protected RestException |
setOccurrence(int occurrence)
Deprecated.
|
protected RestException |
setStatus(int status)
Deprecated.
Set the status code on this exception.
|
String |
toString()
Deprecated.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public RestException(Throwable cause, int status, String msg, Object... args)
cause
- The cause of this exception.status
- The HTTP status code.msg
- The status message.args
- Optional MessageFormat
-style arguments.public RestException(String msg)
msg
- The status message.public RestException(Throwable cause, int status)
cause
- The root exception.status
- The HTTP status code.public RestException(int status, String msg, Object... args)
status
- The HTTP status code.msg
- The status message.args
- Optional MessageFormat
-style arguments.public Throwable getRootCause()
The root cause is the first exception in the init-cause parent chain that's not one of the following:
public String getFullStackMessage(boolean scrubForXssVulnerabilities)
Typically useful if you want to render all the error messages in the stack, but don't want to render all the stack traces too.
scrubForXssVulnerabilities
- If @Deprecated protected RestException setOccurrence(int occurrence)
occurrence
- The number of times this exception has occurred.protected RestException setStatus(int status)
status
- The status code.@Deprecated public int getOccurrence()
@RestResource(useStackTraceHashes)
is enabled, or public int getStatus()
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.