20 #ifndef RIPPLE_PROTOCOL_ERRORCODES_H_INCLUDED
21 #define RIPPLE_PROTOCOL_ERRORCODES_H_INCLUDED
23 #include <ripple/json/json_value.h>
24 #include <ripple/protocol/jss.h>
175 char const* message_)
191 template <
class JsonValue>
196 json[jss::error] = info.
token;
197 json[jss::error_code] = info.
code;
198 json[jss::error_message] = info.
message;
201 template <
class JsonValue>
208 template <
class JsonValue>
213 json[jss::error] = info.
token;
214 json[jss::error_code] = info.
code;
215 json[jss::error_message] = message;
239 return "Missing field '" + name +
"'.";
257 return "Invalid field '" + name +
"', not object.";
275 return "Invalid field '" + name +
"'.";
299 return "Invalid field '" + name +
"', not " + type +
".";
ErrorInfo const & get_error_info(error_code_i code)
Returns an ErrorInfo that reflects the error code.
std::string missing_field_message(std::string const &name)
std::string rpcErrorString(Json::Value const &jv)
Returns a single string with the contents of an RPC error.
@ rpcREPORTING_UNSUPPORTED
Json::Value object_field_error(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::StaticString message
std::string expected_field_message(std::string const &name, std::string const &type)
@ warnRPC_AMENDMENT_BLOCKED
std::string object_field_message(std::string const &name)
bool contains_error(Json::Value const &json)
Returns true if the json contains an rpc error specification.
warning_code_i
Codes returned in the warnings array of certain RPC commands.
@ warnRPC_EXPIRED_VALIDATOR_LIST
@ warnRPC_UNSUPPORTED_MAJORITY
Maps an rpc error code to its token and default message.
Json::Value not_validator_error()
@ rpcCHANNEL_AMT_MALFORMED
std::string invalid_field_message(std::string const &name)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Lightweight wrapper to tag static string.
Json::Value make_param_error(std::string const &message)
Returns a new json object that indicates invalid parameters.
constexpr ErrorInfo(error_code_i code_, char const *token_, char const *message_)
void inject_error(error_code_i code, JsonValue &json)
Add or update the json update to reflect the error code.
Json::Value invalid_field_error(std::string const &name)
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
@ rpcEXPIRED_VALIDATOR_LIST