20 #include <ripple/protocol/ErrorCodes.h>
47 {
rpcBAD_SECRET,
"badSecret",
"Secret does not match account."},
58 {
rpcDST_AMT_MISSING,
"dstAmtMissing",
"Destination amount/currency/issuer is missing."},
63 {
rpcHIGH_FEE,
"highFee",
"Current transaction fee exceeds your limit."},
67 {
rpcJSON_RPC,
"json_rpc",
"JSON-RPC transport error."},
75 {
rpcNOT_READY,
"notReady",
"Not ready to handle this request."},
77 {
rpcNO_CLOSED,
"noClosed",
"Closed ledger is unavailable."},
78 {
rpcNO_CURRENT,
"noCurrent",
"Current ledger is unavailable."},
80 {
rpcNO_EVENTS,
"noEvents",
"Current transport does not support events."},
82 {
rpcNO_PERMISSION,
"noPermission",
"You don't have permission for this command."},
87 {
rpcSLOW_DOWN,
"slowDown",
"You are placing too much load on the server."},
94 {
rpcTOO_BUSY,
"tooBusy",
"The server is too busy to help you now."},
123 template <
int M,
int N>
135 static_assert(
rpcSUCCESS == 0,
"Unexpected error_code_i layout.");
136 int const index{info.code - 1};
141 ret.
infos[index].code = info.code;
142 ret.
infos[index].token = info.token;
143 ret.
infos[index].message = info.message;
159 if (info.
code != expect)
182 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
@ rpcREPORTING_UNSUPPORTED
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.
@ rpcEXPIRED_VALIDATOR_LIST
std::string asString() const
Returns the unquoted string value.