20 #include <ripple/protocol/ErrorCodes.h>
42 "Amendment blocked, need upgrade."},
45 "Use the new API or specify a ledger range."},
50 {
rpcBAD_SECRET,
"badSecret",
"Secret does not match account."},
55 "channelAmtMalformed",
56 "Payment channel amount is malformed."},
60 "Database deserialization error."},
63 "Destination account is malformed."},
68 "Destination amount/currency/issuer is malformed."},
71 "Destination amount/currency/issuer is missing."},
74 "Destination issuer is malformed."},
77 {
rpcHIGH_FEE,
"highFee",
"Current transaction fee exceeds your limit."},
81 {
rpcJSON_RPC,
"json_rpc",
"JSON-RPC transport error."},
89 {
rpcNOT_READY,
"notReady",
"Not ready to handle this request."},
91 {
rpcNO_CLOSED,
"noClosed",
"Closed ledger is unavailable."},
92 {
rpcNO_CURRENT,
"noCurrent",
"Current ledger is unavailable."},
93 {
rpcNO_EVENTS,
"noEvents",
"Current transport does not support events."},
94 {
rpcNO_NETWORK,
"noNetwork",
"Not synced to Ripple network."},
97 "You don't have permission for this command."},
102 "Signing of transaction is malformed."},
103 {
rpcSLOW_DOWN,
"slowDown",
"You are placing too much load on the server."},
110 {
rpcTOO_BUSY,
"tooBusy",
"The server is too busy to help you now."},
137 template <
int M,
int N>
149 static_assert(
rpcSUCCESS == 0,
"Unexpected error_code_i layout.");
150 int const index{info.code - 1};
155 ret.
infos[index].code = info.code;
156 ret.
infos[index].token = info.token;
157 ret.
infos[index].message = info.message;
173 if (info.
code != expect)
196 if (code <= rpcSUCCESS || code >
rpcLAST)
ErrorInfo const & get_error_info(error_code_i code)
Returns an ErrorInfo that reflects the error code.
std::string rpcErrorString(Json::Value const &jv)
Returns a single string with the contents of an RPC error.
constexpr auto sortedErrorInfos
bool contains_error(Json::Value const &json)
Returns true if the json contains an rpc error specification.
bool isMember(const char *key) const
Return true if the object has a member named key.
Maps an rpc error code to its token and default message.
constexpr ErrorInfo unknownError
@ rpcCHANNEL_AMT_MALFORMED
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr auto sortErrorInfos(ErrorInfo const (&unordered)[N]) -> ErrorInfoArray< M >
constexpr static ErrorInfo unorderedErrorInfos[]
void inject_error(error_code_i code, JsonValue &json)
Add or update the json update to reflect the error code.
constexpr ErrorInfoArray()
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
std::string asString() const
Returns the unquoted string value.