Class 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 Details

    • httpMessage

      public final String httpMessage
    • httpCode

      public final int httpCode
    • jsonRpcCode

      public final int jsonRpcCode
    • response

      public final String response
      Http response body as a string. Null if not-available (check deserialized JSON in this case)
    • responseJson

      public final JsonRpcResponse<?> responseJson
      Deserialized response message, if available. Null if not-available. Result is usually null when an error occurs, but the type of the result is unspecified and could be either Map, JsonNode, or the result type of the failed request depending upon where and how the exception was created.
  • 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 message
      httpCode - HTTP status code, e.g. 404
      httpMessage - HTTP status message, e.g. "Not found" (removed from HTTP/2 and HTTP/3)
      jsonRPCCode - Integer error code in JSON response, if any
      responseBody - 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 the httpCode parameter. (which is not present in java.net.http, HTTP/2, etc.)
    • JsonRpcStatusException

      public JsonRpcStatusException(int httpCode, JsonRpcResponse<?> responseBodyJson)
      Constructor for when we were able to deserialize a JSON response
      Parameters:
      httpCode - http status code
      responseBodyJson - deserialized JSON
    • JsonRpcStatusException

      public JsonRpcStatusException(int httpCode, String responseBody)
      Constructor for when we were unable to deserialize a JSON response
      Parameters:
      httpCode - http status code
      responseBody - response body as a string