Class ErrorMessage
- java.lang.Object
-
- io.streamthoughts.azkarra.http.data.ErrorMessage
-
- All Implemented Interfaces:
Serializable
public class ErrorMessage extends Object implements Serializable
The error message response object.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ErrorMessage(int errorCode, String message, String path)
Creates a newErrorMessage
instance.ErrorMessage(int errorCode, String message, String exception, String path)
Creates a newErrorMessage
instance.ErrorMessage(int errorCode, String message, Throwable exception, String path)
Creates a newErrorMessage
instance.ErrorMessage(int errorCode, Throwable exception, String path)
Creates a newErrorMessage
instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getErrorCode()
String
getException()
String
getMessage()
String
getPath()
static ErrorMessage
of(Throwable exception, String path)
Static helper method for mapping an given exception to a newErrorMessage
.
-
-
-
Constructor Detail
-
ErrorMessage
public ErrorMessage(int errorCode, Throwable exception, String path)
Creates a newErrorMessage
instance.- Parameters:
errorCode
- the error code.exception
- the error exception cause.path
- the uri relative path.
-
ErrorMessage
public ErrorMessage(int errorCode, String message, Throwable exception, String path)
Creates a newErrorMessage
instance.- Parameters:
errorCode
- the error code.message
- the error message.exception
- the error exception cause.path
- the uri relative path.
-
ErrorMessage
public ErrorMessage(int errorCode, String message, String path)
Creates a newErrorMessage
instance.- Parameters:
errorCode
- the error code.message
- the error message.path
- the uri relative path.
-
ErrorMessage
public ErrorMessage(int errorCode, String message, String exception, String path)
Creates a newErrorMessage
instance.- Parameters:
errorCode
- the error code.message
- the error message.exception
- the error exception cause.path
- the uri relative path.
-
-
Method Detail
-
getErrorCode
public int getErrorCode()
-
getMessage
public String getMessage()
-
getException
public String getException()
-
getPath
public String getPath()
-
of
public static ErrorMessage of(Throwable exception, String path)
Static helper method for mapping an given exception to a newErrorMessage
.- Parameters:
exception
- the exception.path
- the rest call path.- Returns:
- the
ErrorMessage
; cannot returnnull
.
-
-