class
ACP::JsonRpcError
- ACP::JsonRpcError
- ACP::Error
- Exception
- Reference
- Object
Overview
Represents a JSON-RPC 2.0 error returned by the agent. See: https://www.jsonrpc.org/specification#error_object
Defined in:
acp/errors.crConstant Summary
-
AUTH_REQUIRED =
-32000 -
Authentication is required before this operation can be performed.
-
INTERNAL_ERROR =
-32603 -
INVALID_PARAMS =
-32602 -
INVALID_REQUEST =
-32600 -
METHOD_NOT_FOUND =
-32601 -
PARSE_ERROR =
-32700 -
Standard JSON-RPC 2.0 error codes
-
RESOURCE_NOT_FOUND =
-32002 -
A given resource, such as a file, was not found.
-
SERVER_ERROR_END =
-32000 -
SERVER_ERROR_START =
-32099 -
JSON-RPC 2.0 reserved range for server errors: -32000 to -32099
Constructors
-
.from_json_any(obj : JSON::Any) : JsonRpcError
Constructs a
JsonRpcErrorfrom a rawJSON::Anyerror object. - .new(code : Int32, message : String, data : JSON::Any | Nil = nil)
Instance Method Summary
-
#auth_required? : Bool
Returns true if this is an ACP authentication-required error.
-
#code : Int32
The integer error code.
-
#data : JSON::Any | Nil
Optional structured data attached to the error.
-
#internal_error? : Bool
Returns true if this is a standard JSON-RPC internal error.
-
#invalid_params? : Bool
Returns true if this is a standard JSON-RPC invalid params error.
-
#invalid_request? : Bool
Returns true if this is a standard JSON-RPC invalid request error.
-
#method_not_found? : Bool
Returns true if this is a standard JSON-RPC method-not-found error.
-
#parse_error? : Bool
Returns true if this is a standard JSON-RPC parse error.
-
#resource_not_found? : Bool
Returns true if this is an ACP resource-not-found error.
-
#server_error? : Bool
Returns true if the error code falls in the server-defined range.
-
#to_s(io : IO) : Nil
Builds a human-readable representation including the code.
Constructor Detail
Constructs a JsonRpcError from a raw JSON::Any error object.
Expects the object to have "code" (int) and "message" (string) keys,
with an optional "data" key.