3#include <xrpl/json/json_value.h>
4#include <xrpl/protocol/jss.h>
227 return "Missing field '" + name +
"'.";
245 return "Invalid field '" + name +
"', not object.";
263 return "Invalid field '" + name +
"'.";
287 return "Invalid field '" + name +
"', not " + type +
".";
Lightweight wrapper to tag static string.
JSON (JavaScript Object Notation).
std::string missingFieldMessage(std::string const &name)
json::Value notValidatorError()
json::Value objectFieldError(std::string const &name)
std::string invalidFieldMessage(std::string const &name)
json::Value makeError(ErrorCodeI code)
Returns a new json object that reflects the error code.
int errorCodeHttpStatus(ErrorCodeI code)
Returns http status that corresponds to the error code.
std::string objectFieldMessage(std::string const &name)
ErrorInfo const & getErrorInfo(ErrorCodeI code)
Returns an ErrorInfo that reflects the error code.
void injectError(ErrorCodeI code, json::Value &json)
Add or update the json update to reflect the error code.
std::string expectedFieldMessage(std::string const &name, std::string const &type)
bool containsError(json::Value const &json)
Returns true if the json contains an rpc error specification.
json::Value invalidFieldError(std::string const &name)
json::Value makeParamError(std::string const &message)
Returns a new json object that indicates invalid parameters.
json::Value missingFieldError(std::string const &name)
json::Value expectedFieldError(std::string const &name, std::string const &type)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
WarningCodeI
Codes returned in the warnings array of certain RPC commands.
@ WarnRpcAmendmentBlocked
@ WarnRpcFieldsDeprecated
@ WarnRpcUnsupportedMajority
@ WarnRpcExpiredValidatorList
@ RpcExpiredValidatorList
@ RpcUnexpectedLedgerType
@ RpcReportingUnsupported
std::string rpcErrorString(json::Value const &jv)
Returns a single string with the contents of an RPC error.
Maps an rpc error code to its token, default message, and HTTP status.
constexpr ErrorInfo(ErrorCodeI code, char const *token, char const *message)
json::StaticString message
constexpr ErrorInfo(ErrorCodeI code, char const *token, char const *message, int httpStatus)