Public Types | |
| enum | ErrorType { HttpErrorType, CrateErrorType, OtherErrorType } |
Public Member Functions | |
| BlobResult () | |
| BlobResult (const std::string &error, ErrorType type) | |
| const std::string & | errorString () const |
| ErrorType | errorType () const |
| bool | hasError () const |
| bool | isCrateError () const |
| const std::string & | key () const |
| operator bool () const | |
| void | setErrorString (const std::string &error, ErrorType type) |
| void | setKey (const std::string &key) |
The class BlobResult encapsulates Crate's HTTP endpoint reply of a blob operation.
A blob operation can fail because of a network error or an error issued by Crate. To determine if a blob operation was successful you can investigate the result the Client returns:
| CppCrate::BlobResult::BlobResult | ( | ) |
Constructs an empty result.
| CppCrate::BlobResult::BlobResult | ( | const std::string & | error, |
| BlobResult::ErrorType | type | ||
| ) |
Constructs a result with the error string error and the type type.
| const std::string & CppCrate::BlobResult::errorString | ( | ) | const |
Returns the error string.
| BlobResult::ErrorType CppCrate::BlobResult::errorType | ( | ) | const |
Returns the error type.
| bool CppCrate::BlobResult::hasError | ( | ) | const |
Returns whether the result has an error.
| bool CppCrate::BlobResult::isCrateError | ( | ) | const |
Returns whether the error is Crate related.
| const std::string & CppCrate::BlobResult::key | ( | ) | const |
Returns the key of the processed blob.
|
explicit |
Returns whether the result is valid.
| void CppCrate::BlobResult::setErrorString | ( | const std::string & | error, |
| ErrorType | type | ||
| ) |
Sets the error string to error and it's type to type.
| void CppCrate::BlobResult::setKey | ( | const std::string & | key | ) |
Sets the key of the processed blob to key.