1#ifndef XRPL_PROTOCOL_ERRORCODES_H_INCLUDED
2#define XRPL_PROTOCOL_ERRORCODES_H_INCLUDED
4#include <xrpl/json/json_value.h>
5#include <xrpl/protocol/jss.h>
175 ,
message(
"An unknown error code.")
183 char const* message_)
191 char const* message_,
238 return "Missing field '" + name +
"'.";
256 return "Invalid field '" + name +
"', not object.";
274 return "Invalid field '" + name +
"'.";
298 return "Invalid field '" + name +
"', not " + type +
".";
Lightweight wrapper to tag static string.
Json::Value invalid_field_error(std::string const &name)
std::string expected_field_message(std::string const &name, std::string const &type)
int error_code_http_status(error_code_i code)
Returns http status that corresponds to the error code.
std::string missing_field_message(std::string const &name)
Json::Value expected_field_error(std::string const &name, std::string const &type)
Json::Value missing_field_error(std::string const &name)
Json::Value object_field_error(std::string const &name)
ErrorInfo const & get_error_info(error_code_i code)
Returns an ErrorInfo that reflects the error code.
std::string object_field_message(std::string const &name)
Json::Value not_validator_error()
Json::Value make_param_error(std::string const &message)
Returns a new json object that indicates invalid parameters.
void inject_error(error_code_i code, Json::Value &json)
Add or update the json update to reflect the error code.
std::string invalid_field_message(std::string const &name)
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
bool contains_error(Json::Value const &json)
Returns true if the json contains an rpc error specification.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::string rpcErrorString(Json::Value const &jv)
Returns a single string with the contents of an RPC error.
@ rpcUNEXPECTED_LEDGER_TYPE
@ rpcCHANNEL_AMT_MALFORMED
@ rpcDELEGATE_ACT_NOT_FOUND
@ rpcEXPIRED_VALIDATOR_LIST
@ rpcREPORTING_UNSUPPORTED
warning_code_i
Codes returned in the warnings array of certain RPC commands.
@ warnRPC_AMENDMENT_BLOCKED
@ warnRPC_UNSUPPORTED_MAJORITY
@ warnRPC_FIELDS_DEPRECATED
@ warnRPC_EXPIRED_VALIDATOR_LIST
Maps an rpc error code to its token, default message, and HTTP status.
constexpr ErrorInfo(error_code_i code_, char const *token_, char const *message_, int http_status_)
constexpr ErrorInfo(error_code_i code_, char const *token_, char const *message_)
Json::StaticString message