JSON RPC
JSON-RPC 2.0 library for C++
Error Messages

Error messages used by the library. These constants can be useful in unit tests. More...

Variables

static constexpr std::string_view wwa::json_rpc::err_bad_id_type = "ID must be either a number, a string, or null"
 Error message for when the ID is not a number, a string, or null.
 
static constexpr std::string_view wwa::json_rpc::err_bad_params_type = "Parameters must be either an array or an object or omitted"
 Error message for when the parameters are not an array or an object.
 
static constexpr std::string_view wwa::json_rpc::err_empty_batch = "Empty batch request"
 Error message for when the batch request is empty.
 
static constexpr std::string_view wwa::json_rpc::err_empty_method = "Method cannot be empty"
 Error message for when the method is empty.
 
static constexpr std::string_view wwa::json_rpc::err_invalid_params_passed_to_method = "Invalid parameters passed to method"
 Error message for when the parameters passed to the method are not correct.
 
static constexpr std::string_view wwa::json_rpc::err_method_not_found = "Method not found"
 Error message for when the method is not found.
 
static constexpr std::string_view wwa::json_rpc::err_not_jsonrpc_2_0_request = "Not a JSON-RPC 2.0 request"
 Error message for when the request is not a JSON-RPC 2.0 request.
 

Detailed Description

Error messages used by the library. These constants can be useful in unit tests.

Variable Documentation

◆ err_bad_id_type

std::string_view wwa::json_rpc::err_bad_id_type = "ID must be either a number, a string, or null"
staticconstexpr

Error message for when the ID is not a number, a string, or null.

See also
exception::INVALID_REQUEST
https://www.jsonrpc.org/specification#request_object

> An identifier established by the Client that MUST contain a String, Number, or NULL value if included.

Definition at line 63 of file exception.h.

◆ err_bad_params_type

std::string_view wwa::json_rpc::err_bad_params_type = "Parameters must be either an array or an object or omitted"
staticconstexpr

Error message for when the parameters are not an array or an object.

See also
exception::INVALID_PARAMS

Definition at line 55 of file exception.h.

◆ err_empty_batch

std::string_view wwa::json_rpc::err_empty_batch = "Empty batch request"
staticconstexpr

Error message for when the batch request is empty.

See also
exception::INVALID_REQUEST
https://www.jsonrpc.org/specification#batch

Definition at line 70 of file exception.h.

◆ err_empty_method

std::string_view wwa::json_rpc::err_empty_method = "Method cannot be empty"
staticconstexpr

Error message for when the method is empty.

See also
exception::INVALID_REQUEST

Definition at line 49 of file exception.h.

◆ err_invalid_params_passed_to_method

std::string_view wwa::json_rpc::err_invalid_params_passed_to_method = "Invalid parameters passed to method"
staticconstexpr

Error message for when the parameters passed to the method are not correct.

See also
exception::INVALID_PARAMS

Definition at line 37 of file exception.h.

◆ err_method_not_found

std::string_view wwa::json_rpc::err_method_not_found = "Method not found"
staticconstexpr

Error message for when the method is not found.

See also
exception::METHOD_NOT_FOUND

Definition at line 43 of file exception.h.

◆ err_not_jsonrpc_2_0_request

std::string_view wwa::json_rpc::err_not_jsonrpc_2_0_request = "Not a JSON-RPC 2.0 request"
staticconstexpr

Error message for when the request is not a JSON-RPC 2.0 request.

See also
exception::INVALID_REQUEST
https://www.jsonrpc.org/specification#request_object

> jsonrpc: A String specifying the version of the JSON-RPC protocol. MUST be exactly "2.0".

Definition at line 31 of file exception.h.