Package eliasstar.jsonrpc.exceptions
Class ErrorResponseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- eliasstar.jsonrpc.exceptions.RpcException
-
- eliasstar.jsonrpc.exceptions.ErrorResponseException
-
- All Implemented Interfaces:
Serializable
public final class ErrorResponseException extends RpcException
- Since:
- 0.1.0
- Author:
- Elias*
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ErrorResponseException(long code, String message)
Creates aErrorResponseException
without additional data.ErrorResponseException(long code, String message, com.google.gson.JsonElement data)
Creates aErrorResponseException
with additional data.ErrorResponseException(Error error)
Creates aErrorResponseException
from anError
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getErrorCode()
Getter for error code.Optional<com.google.gson.JsonElement>
getErrorData()
Getter for error data.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ErrorResponseException
public ErrorResponseException(Error error)
Creates aErrorResponseException
from anError
.- Parameters:
error
- The error received
-
ErrorResponseException
public ErrorResponseException(long code, String message)
Creates aErrorResponseException
without additional data.- Parameters:
code
- The error type that occurredmessage
- A short description of the error
-
ErrorResponseException
public ErrorResponseException(long code, String message, com.google.gson.JsonElement data)
Creates aErrorResponseException
with additional data.- Parameters:
code
- The error type that occurredmessage
- A short description of the errordata
- Additional information about the error
-
-
Method Detail
-
getErrorCode
public long getErrorCode()
Getter for error code.- Returns:
- A number that indicates the error type that occurred
-
getErrorData
public Optional<com.google.gson.JsonElement> getErrorData()
Getter for error data.- Returns:
- A value that contains additional information about the error
-
-