3#include <xrpl/beast/utility/instrumentation.h>
4#include <xrpl/json/json_value.h>
5#include <xrpl/protocol/ErrorCodes.h>
6#include <xrpl/protocol/TER.h>
91 XRPL_ASSERT(
type_ ==
Type::TER,
"xrpl::rpc::Status::toTER : type is TER");
static constexpr TERSubset fromInt(int from)
API version numbers used in later API versions.
void injectError(ErrorCodeI code, json::Value &json)
Add or update the json update to reflect the error code.
constexpr TERUnderlyingType TERtoInt(TELcodes v)
TERSubset< CanCvtToTER > TER
Status(ErrorCodeI e, std::string const &s)
void inject(json::Value &object) const
Apply the Status to a JsonObject.
Status(T code, Strings d={})
TER toTER() const
Returns the Status as a TER.
std::vector< std::string > Strings
ErrorCodeI toErrorCode() const
Returns the Status as an error_code_i.
void fillJson(json::Value &)
Fill a json::Value with an RPC 2.0 response.
std::string toString() const
Status(ErrorCodeI e, Strings d={})
Strings const & messages() const
Status(TER ter, Strings d={})
static constexpr Code kOK
std::string codeString() const
If the Status is OK, the result is an empty string.
bool operator!() const
Returns true if the Status is OK.
std::string message() const
Return the first message, if any.