20 #include <ripple/protocol/ErrorCodes.h>
54 {
rpcATX_DEPRECATED,
"deprecated",
"Use the new API or specify a ledger range.", 400},
56 {
rpcBAD_FEATURE,
"badFeature",
"Feature unknown or invalid.", 500},
57 {
rpcBAD_ISSUER,
"badIssuer",
"Issuer account malformed.", 400},
59 {
rpcBAD_SECRET,
"badSecret",
"Secret does not match account.", 403},
69 {
rpcDST_AMT_MALFORMED,
"dstAmtMalformed",
"Destination amount/currency/issuer is malformed.", 400},
70 {
rpcDST_AMT_MISSING,
"dstAmtMissing",
"Destination amount/currency/issuer is missing.", 400},
75 {
rpcHIGH_FEE,
"highFee",
"Current transaction fee exceeds your limit.", 402},
79 {
rpcJSON_RPC,
"json_rpc",
"JSON-RPC transport error.", 500},
85 {
rpcNOT_ENABLED,
"notEnabled",
"Not enabled in configuration.", 501},
87 {
rpcNOT_READY,
"notReady",
"Not ready to handle this request.", 503},
89 {
rpcNO_CLOSED,
"noClosed",
"Closed ledger is unavailable.", 503},
90 {
rpcNO_CURRENT,
"noCurrent",
"Current ledger is unavailable.", 503},
91 {
rpcNOT_SYNCED,
"notSynced",
"Not synced to the network.", 503},
92 {
rpcNO_EVENTS,
"noEvents",
"Current transport does not support events.", 405},
93 {
rpcNO_NETWORK,
"noNetwork",
"Not synced to the network.", 503},
94 {
rpcNO_PERMISSION,
"noPermission",
"You don't have permission for this command.", 401},
95 {
rpcNO_PF_REQUEST,
"noPathRequest",
"No pathfinding request in progress.", 404},
98 {
rpcREPORTING_UNSUPPORTED,
"reportingUnsupported",
"Requested operation not supported by reporting mode server", 405},
101 {
rpcSLOW_DOWN,
"slowDown",
"You are placing too much load on the server.", 429},
108 {
rpcTOO_BUSY,
"tooBusy",
"The server is too busy to help you now.", 503},
115 template <
int M,
int N>
127 static_assert(
rpcSUCCESS == 0,
"Unexpected error_code_i layout.");
128 int const index{info.code - 1};
149 if (info.code != expect)
172 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
constexpr auto sortErrorInfos(ErrorInfo const (&unordered)[N]) -> std::array< ErrorInfo, M >
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, default message, and HTTP status.
constexpr ErrorInfo unknownError
@ rpcCHANNEL_AMT_MALFORMED
int error_code_http_status(error_code_i code)
Returns http status that corresponds to the error code.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr static ErrorInfo unorderedErrorInfos[]
void inject_error(error_code_i code, JsonValue &json)
Add or update the json update to reflect the error code.
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.