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 APIExceptionaddErrorMessage(String errorMessage)APIExceptionaddFieldError(String name, String error)booleanequals(Object o)intgetApiErrorCode()ThrowablegetCause()List<APILogMessage>getErrorMessages()Map<String,LinkedList<String>>getFieldErrors()intgetHttpErrorCode()LocalegetLocale()StringgetLocalizedMessage()StringgetMessage()ObjectgetPayload()StringgetResult()StackTraceElement[]getStackTrace()inthashCode()APIExceptionsetApiErrorCode(int apiErrorCode)voidsetErrorMessages(List<APILogMessage> logMessages)APIExceptionsetFieldErrors(Map<String,LinkedList<String>> fieldErrors)APIExceptionsetFieldErrors(BindingResult result)APIExceptionsetHttpErrorCode(int httpErrorCode)voidsetLocale(Locale locale)APIExceptionsetPayload(Object payload)voidsetResult(String result)StringtoString()-
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:
getLocalizedMessagein 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:
getMessagein classThrowable
-
getStackTrace
public StackTraceElement[] getStackTrace()
- Overrides:
getStackTracein classThrowable
-
-