public final class ServiceException
extends java.lang.RuntimeException
implements com.palantir.logsafe.SafeLoggable
ServiceException thrown in server-side code to indicate server-side error states.| Constructor and Description |
|---|
ServiceException(ErrorType errorType,
com.palantir.logsafe.Arg<?>... parameters)
Creates a new exception for the given error.
|
ServiceException(ErrorType errorType,
java.lang.Throwable cause,
com.palantir.logsafe.Arg<?>... args)
As above, but additionally records the cause of this exception.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<com.palantir.logsafe.Arg<?>> |
getArgs() |
java.lang.String |
getErrorInstanceId()
A unique identifier for (this instance of) this error.
|
ErrorType |
getErrorType()
The
ErrorType that gave rise to this exception. |
java.lang.String |
getLogMessage() |
java.lang.String |
getMessage() |
java.util.List<com.palantir.logsafe.Arg<?>> |
getParameters()
Deprecated.
use
getArgs(). |
public ServiceException(ErrorType errorType, com.palantir.logsafe.Arg<?>... parameters)
parameters are propagated to
clients; they are serialized via Object.toString().public ServiceException(ErrorType errorType, @Nullable java.lang.Throwable cause, com.palantir.logsafe.Arg<?>... args)
public java.lang.String getErrorInstanceId()
public java.lang.String getMessage()
getMessage in class java.lang.Throwablepublic java.lang.String getLogMessage()
getLogMessage in interface com.palantir.logsafe.SafeLoggablepublic java.util.List<com.palantir.logsafe.Arg<?>> getArgs()
getArgs in interface com.palantir.logsafe.SafeLoggable@Deprecated public java.util.List<com.palantir.logsafe.Arg<?>> getParameters()
getArgs().