Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc::Status Struct Reference

A status returned from any RPC handler. More...

#include <Errors.hpp>

Public Member Functions

 Status (CombinedError code)
 Construct a new Status object.
 
 Status (CombinedError code, boost::json::object &&extraInfo)
 Construct a new Status object.
 
 Status (std::string message)
 Construct a new Status object with a custom message.
 
 Status (CombinedError code, std::string message)
 Construct a new Status object.
 
 Status (CombinedError code, std::string error, std::string message)
 Construct a new Status object.
 
bool operator== (Status const &other) const =default
 
 operator bool () const
 Check if the status is not OK.
 
bool operator== (RippledError other) const
 Returns true if the rpc::Status contains the desired rpc::RippledError.
 
bool operator== (ClioError other) const
 Returns true if the Status contains the desired ClioError.
 

Public Attributes

CombinedError code = RippledError::rpcSUCCESS
 
std::string error
 
std::string message
 
std::optional< boost::json::object > extraInfo
 

Detailed Description

A status returned from any RPC handler.

Constructor & Destructor Documentation

◆ Status() [1/5]

rpc::Status::Status ( CombinedError code)
inline

Construct a new Status object.

Parameters
codeThe error code

◆ Status() [2/5]

rpc::Status::Status ( CombinedError code,
boost::json::object && extraInfo )
inline

Construct a new Status object.

Parameters
codeThe error code
extraInfoThe extra info

◆ Status() [3/5]

rpc::Status::Status ( std::string message)
inlineexplicit

Construct a new Status object with a custom message.

Note
HACK. Some rippled handlers explicitly specify errors. This means that we have to be able to duplicate this functionality.
Parameters
messageThe message

◆ Status() [4/5]

rpc::Status::Status ( CombinedError code,
std::string message )
inline

Construct a new Status object.

Parameters
codeThe error code
messageThe message

◆ Status() [5/5]

rpc::Status::Status ( CombinedError code,
std::string error,
std::string message )
inline

Construct a new Status object.

Parameters
codeThe error code
errorThe error
messageThe message

Member Function Documentation

◆ operator bool()

rpc::Status::operator bool ( ) const
inline

Check if the status is not OK.

Returns
true if the status is not OK; false otherwise

◆ operator==() [1/2]

bool rpc::Status::operator== ( ClioError other) const
inline

Returns true if the Status contains the desired ClioError.

Parameters
otherThe RippledError to match
Returns
true if status matches given error; false otherwise

◆ operator==() [2/2]

bool rpc::Status::operator== ( RippledError other) const
inline

Returns true if the rpc::Status contains the desired rpc::RippledError.

Parameters
otherThe rpc::RippledError to match
Returns
true if status matches given error; false otherwise

The documentation for this struct was generated from the following file: