Package eu.woolplatform.utils.json.rpc
Class JsonRpcException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- eu.woolplatform.utils.json.rpc.JsonRpcException
-
- All Implemented Interfaces:
Serializable
public class JsonRpcException extends Exception
This exception is thrown when a JSON-RPC request results in a response with an error.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JsonRpcException(String message, int code)Constructs a new JSON-RPC exception.JsonRpcException(String message, int code, Object data)Constructs a new JSON-RPC exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCode()Returns the error code.ObjectgetData()Returns additional data about the error.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
JsonRpcException
public JsonRpcException(String message, int code)
Constructs a new JSON-RPC exception.- Parameters:
message- the error messagecode- the error code
-
-
Method Detail
-
getCode
public int getCode()
Returns the error code.- Returns:
- the error code
-
getData
public Object getData()
Returns additional data about the error. This may be null. The data can be converted to a JSON string.- Returns:
- additional data about the error or null
-
-