Package io.toro.martini.api
Class APIException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.toro.martini.api.APIException
-
- All Implemented Interfaces:
Serializable
public class APIException extends RuntimeException
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description APIException()
APIException(String message)
APIException(String message, int httpErrorCode)
APIException(String message, int httpErrorCode, int apiErrorCode)
APIException(String message, int httpErrorCode, int apiErrorCode, List<APILogMessage> logMessages)
APIException(String message, int httpErrorCode, int apiErrorCode, List<APILogMessage> logMessages, Map<String,LinkedList<String>> fieldErrors)
APIException(String message, int httpErrorCode, Object payload)
APIException(String message, int httpErrorCode, Throwable cause)
APIException(String message, Throwable exception)
APIException(String message, HttpStatus status)
APIException(Throwable exception)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description APIException
addErrorMessage(String errorMessage)
APIException
addFieldError(String name, String error)
boolean
equals(Object o)
int
getApiErrorCode()
Throwable
getCause()
List<APILogMessage>
getErrorMessages()
Map<String,LinkedList<String>>
getFieldErrors()
int
getHttpErrorCode()
Locale
getLocale()
String
getLocalizedMessage()
String
getMessage()
Object
getPayload()
String
getResult()
StackTraceElement[]
getStackTrace()
int
hashCode()
APIException
setApiErrorCode(int apiErrorCode)
void
setErrorMessages(List<APILogMessage> logMessages)
APIException
setFieldErrors(Map<String,LinkedList<String>> fieldErrors)
APIException
setFieldErrors(BindingResult result)
APIException
setHttpErrorCode(int httpErrorCode)
void
setLocale(Locale locale)
APIException
setPayload(Object payload)
void
setResult(String result)
String
toString()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
APIException
public APIException()
-
APIException
public APIException(Throwable exception)
-
APIException
public APIException(String message, HttpStatus status)
-
APIException
public APIException(String message, int httpErrorCode)
-
APIException
public APIException(String message)
-
APIException
public APIException(String message, int httpErrorCode, int apiErrorCode)
-
APIException
public APIException(String message, int httpErrorCode, int apiErrorCode, List<APILogMessage> logMessages)
-
APIException
public APIException(String message, int httpErrorCode, int apiErrorCode, List<APILogMessage> logMessages, Map<String,LinkedList<String>> fieldErrors)
-
-
Method Detail
-
getResult
public String getResult()
-
setResult
public void setResult(String result)
-
setLocale
public void setLocale(Locale locale)
-
getLocale
public Locale getLocale()
-
getHttpErrorCode
public int getHttpErrorCode()
-
setHttpErrorCode
public APIException setHttpErrorCode(int httpErrorCode)
-
getApiErrorCode
public int getApiErrorCode()
-
setApiErrorCode
public APIException setApiErrorCode(int apiErrorCode)
-
getPayload
public Object getPayload()
-
setPayload
public APIException setPayload(Object payload)
-
getErrorMessages
public List<APILogMessage> getErrorMessages()
-
setErrorMessages
public void setErrorMessages(List<APILogMessage> logMessages)
-
getFieldErrors
public Map<String,LinkedList<String>> getFieldErrors()
-
getLocalizedMessage
public String getLocalizedMessage()
- Overrides:
getLocalizedMessage
in classThrowable
-
setFieldErrors
public APIException setFieldErrors(Map<String,LinkedList<String>> fieldErrors)
-
setFieldErrors
public APIException setFieldErrors(BindingResult result)
-
addErrorMessage
public APIException addErrorMessage(String errorMessage)
-
addFieldError
public APIException addFieldError(String name, String error)
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
getStackTrace
public StackTraceElement[] getStackTrace()
- Overrides:
getStackTrace
in classThrowable
-
-