Package org.chenile.base.exception
Class ErrorNumException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.chenile.base.exception.ErrorNumException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BadRequestException
,ConfigurationException
,NotFoundException
,ServerException
An exception that has a HTTP status code and a custom subErrorCode (which can be a specific
error)
These two errors make the exception very specific
It can contain further errors that are supported by the
ResponseMessage
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List<ResponseMessage>
private ResponseMessage
private static final long
-
Constructor Summary
ConstructorDescriptionErrorNumException
(int errorNum, int subErrorNum, Object[] params) /**ErrorNumException
(int errorNum, int subErrorNum, Object[] params, Throwable cause) ErrorNumException
(int errorNum, int subErrorNum, String message) ErrorNumException
(int errorNum, int subErrorNum, String message, Throwable cause) ErrorNumException
(int errorNum, Object[] params) ErrorNumException
(int errorNum, Object[] params, Throwable cause) ErrorNumException
(int errorNum, String message) ErrorNumException
(int errorNum, String message, Throwable cause) ErrorNumException
(ResponseMessage responseMessage) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addError
(ResponseMessage message) int
Object[]
int
void
setMessage
(String message) void
toString()
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
responseMessage
-
errors
-
-
Constructor Details
-
ErrorNumException
public ErrorNumException() -
ErrorNumException
-
ErrorNumException
- Parameters:
errorNum
- - The root error code - same as Http Response codemessage
- - a message in english. Ideally you should use Message bundlescause
- - the root cause of the error
-
ErrorNumException
- Parameters:
errorNum
- - The root error code - same as Http Response codeparams
- - The Params that need to be passed to the message bundlecause
- - the root cause of the error
-
ErrorNumException
- Parameters:
errorNum
- - the root error code - same as Http Response codesubErrorNum
- - the sub error codemessage
- - the message in english. Ideally message bundles must be used.cause
- - the root cause of the error
-
ErrorNumException
- Parameters:
errorNum
- - the root error code - same as Http Response codesubErrorNum
- - the sub error codeparams
- - the params to be passed to the message bundlecause
- - the root cause of the error
-
ErrorNumException
- Parameters:
errorNum
- - the root error code - same as Http Response codemessage
- - the message in english. Ideally message bundles must be used.
-
ErrorNumException
- Parameters:
errorNum
- - the root error code - same as Http Response codeparams
- - the params to be passed to the message bundle
-
ErrorNumException
- Parameters:
errorNum
- - the root error code - same as Http Response codesubErrorNum
- - the sub error codemessage
- - the message in english. Ideally message bundles must be used.
-
ErrorNumException
/**- Parameters:
errorNum
- - the root error code - same as Http Response codesubErrorNum
- - the sub error codeparams
- - the params to be passed to the message bundle
-
-
Method Details
-
getErrorNum
public int getErrorNum() -
getSubErrorNum
public int getSubErrorNum() -
getMessage
- Overrides:
getMessage
in classThrowable
-
setMessage
-
getParams
-
setParams
-
toString
-
getResponseMessage
-
getErrors
-
addError
-