Indicates the result of a OLA API call.
Result objects are the first argument passed to an API callback function. They indicate if the action succeeded.
- Example
void ActionCallback(
const Result &result, ...) {
LOG(WARN) << result.
Error();
return;
}
};
Indicates the result of a OLA API call.
Definition Result.h:52
const std::string & Error() const
Returns the error message if the action failed.
Definition Result.h:73
bool Success() const
Indicates the status of the action. If the action failed Error() can be used to fetch the error messa...
Definition Result.h:67
|
| Result (const std::string &error) |
|
bool | Success () const |
| Indicates the status of the action. If the action failed Error() can be used to fetch the error message.
|
|
const std::string & | Error () const |
| Returns the error message if the action failed.
|
|
◆ Result()
ola::client::Result::Result |
( |
const std::string & | error | ) |
|
|
inlineexplicit |
- Parameters
-
error | the text description of the error. An empty string means the action succeeded. |
◆ Error()
const std::string & ola::client::Result::Error |
( |
| ) |
const |
|
inline |
Returns the error message if the action failed.
- Returns
- the error message.
◆ Success()
bool ola::client::Result::Success |
( |
| ) |
const |
|
inline |
Indicates the status of the action. If the action failed Error() can be used to fetch the error message.
- Returns
- true if the action succeeded, false otherwise.
The documentation for this class was generated from the following file: