Google APIs Client Library for C++
|
namespace error More...
#include "util/status.h"
Public Member Functions | |
Status () | |
Constructs a default OK status. | |
Status (googleapis::util::error::Code code, const StringPiece &msg) | |
Constructs a status with the given code and message. | |
Status (const Status &status) | |
Copy constructor. | |
~Status () | |
Standard destructor. | |
Status & | operator= (const Status &status) |
Assignment operator. | |
bool | operator== (const Status &status) const |
Equality operator. | |
bool | ok () const |
Determine if the status is ok(). | |
const string & | error_message () const |
Get explanation bound at construction. | |
googleapis::util::error::Code | error_code () const |
Get error_code bound at construction. | |
string | ToString () const |
Convert the status to a detailed string. | |
void | IgnoreError () const |
This method is a NOP that confirms we are ignoring a status. |
namespace error
Denotes whether a call or object is error free, and explains why if not.
Status objects are used through the Google APIs Client Library for C++ to return and propagate errors rather than using C++ exceptions. They are simple data objects that support copy and assignment so that they can propagate across scopes and out of dynamic objects that may be destroyed before the error is propagated.
If the status is not ok() then the code() and error_message() will indicate why.
Status | ( | ) | [inline] |
Constructs a default OK status.
Status | ( | googleapis::util::error::Code | code, |
const StringPiece & | msg | ||
) | [inline] |
Constructs a status with the given code and message.
[in] | code | The status code for the instance. |
[in] | msg | If the code is other than OK then this should not be empty. |
~Status | ( | ) | [inline] |
Standard destructor.
googleapis::util::error::Code error_code | ( | ) | const [inline] |
Get error_code bound at construction.
const string& error_message | ( | ) | const [inline] |
Get explanation bound at construction.
void IgnoreError | ( | ) | const [inline] |
This method is a NOP that confirms we are ignoring a status.
bool ok | ( | ) | const [inline] |
Determine if the status is ok().
bool operator== | ( | const Status & | status | ) | const [inline] |
Equality operator.
string ToString | ( | ) | const |
Convert the status to a detailed string.
If displaying the error to a user than error_message might be preferred since it has less technical jargon.