public class ServiceException extends RuntimeException
ServiceException
is the central unchecked exception thrown by the framework and Handler
when an error occurs during event processing via Service.emit(EventContext)
It extends RuntimeException
with an ErrorStatus
, which indicates an internal error code and a mapping to an HTTP status code.Constructor and Description |
---|
ServiceException(ErrorStatus errorStatus,
String message,
Object... args)
Creates a new
ServiceException |
ServiceException(String message,
Object... args)
Creates a new
ServiceException . |
ServiceException(Throwable e)
Creates a new
ServiceException
The ErrorStatus of the first ServiceException found within the cause chain is used. |
Modifier and Type | Method and Description |
---|---|
ErrorStatus |
getErrorStatus() |
String |
getPlainMessage() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ServiceException(String message, Object... args)
ServiceException
. The last argument might be the causing Throwable
and not a formatting argument.
ErrorStatus
of the first ServiceException
found within the cause chain is used.
If no ErrorStatus
is found, it defaults to ErrorStatuses.SERVER_ERROR
.message
- The formatting message, based on SLF4J's MessageFormatter
args
- the arguments to the formatting message. The last argument might the causing Throwable
.public ServiceException(Throwable e)
ServiceException
ErrorStatus
of the first ServiceException
found within the cause chain is used.
If no ErrorStatus
is found, it defaults to ErrorStatuses.SERVER_ERROR
.e
- the causing Throwable
public ServiceException(ErrorStatus errorStatus, String message, Object... args)
ServiceException
errorStatus
- the ErrorStatus
, if null
the ErrorStatus
of the first ServiceException
found within the cause chain is used.
If no ErrorStatus
is found, it defaults to ErrorStatuses.SERVER_ERROR
message
- The formatting message, based on SLF4J's MessageFormatter
args
- the arguments to the formatting message. The last argument might the causing Throwable
.public ErrorStatus getErrorStatus()
ErrorStatus
public String getPlainMessage()
Copyright © 2019. All rights reserved.