public class ErrorCodeException
extends sirius.kernel.health.HandledException
StructuredService
s or in JSON calls (Routed.jsonCall()
).
Adds an additional "code" property to the JSON result which contains the given code. Also the given message is directly reported without any translation or logging.
Constructor and Description |
---|
ErrorCodeException(String code,
String message)
Creates a new exception with the given code and message.
|
Modifier and Type | Method and Description |
---|---|
String |
getCode()
Obtains the error code of this exception.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ErrorCodeException(String code, String message)
Note tha this is a HandledException so no further logging or error reporting will be performed by the system.
code
- the error code to reportmessage
- the message to add to the outputpublic String getCode()
Copyright © 2018. All rights reserved.