Package org.consensusj.jsonrpc
Class JsonRpcStatusException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.consensusj.jsonrpc.JsonRpcException
org.consensusj.jsonrpc.JsonRpcStatusException
- All Implemented Interfaces:
Serializable
JSON-RPC returned HTTP status other than 200 (and unfortunately also sometimes when their is response.error)
Additional information is usually in JSON-RPC response
TODO: See TODO in parent class
JsonRpcException
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionfinal int
final String
final int
final String
Http response body as a string.final JsonRpcResponse
<?> Deserialized response message, if available. -
Constructor Summary
ConstructorDescriptionJsonRpcStatusException
(int httpCode, String responseBody) Constructor for when we were unable to deserialize a JSON responseJsonRpcStatusException
(int httpCode, JsonRpcResponse<?> responseBodyJson) Constructor for when we were able to deserialize a JSON responseJsonRpcStatusException
(String message, int httpCode, int jsonRPCCode, String responseBody, JsonRpcResponse<?> responseBodyJson) Same as canonical, but without thehttpCode
parameter.JsonRpcStatusException
(String message, int httpCode, String httpMessage, int jsonRPCCode, String responseBody, JsonRpcResponse<?> responseBodyJson) Canonical Constructor -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
httpMessage
-
httpCode
-
jsonRpcCode
-
response
Http response body as a string. Null if not-available (check deserialized JSON in this case) -
responseJson
-
-
Constructor Details
-
JsonRpcStatusException
public JsonRpcStatusException(String message, int httpCode, String httpMessage, int jsonRPCCode, String responseBody, JsonRpcResponse<?> responseBodyJson) Canonical Constructor- Parameters:
message
- Error message from Json if available, else http status messagehttpCode
- HTTP status code, e.g. 404httpMessage
- HTTP status message, e.g. "Not found" (removed from HTTP/2 and HTTP/3)jsonRPCCode
- Integer error code in JSON response, if anyresponseBody
- responseBody body as string (null if JSON available)responseBodyJson
- responseBody body as Json Map (null if JSON not-available)
-
JsonRpcStatusException
public JsonRpcStatusException(String message, int httpCode, int jsonRPCCode, String responseBody, JsonRpcResponse<?> responseBodyJson) Same as canonical, but without thehttpCode
parameter. (which is not present in java.net.http, HTTP/2, etc.) -
JsonRpcStatusException
Constructor for when we were able to deserialize a JSON response- Parameters:
httpCode
- http status coderesponseBodyJson
- deserialized JSON
-
JsonRpcStatusException
Constructor for when we were unable to deserialize a JSON response- Parameters:
httpCode
- http status coderesponseBody
- response body as a string
-