ARC SDK
|
Status code returned by many DataPoint methods. More...
#include <arc/data/DataStatus.h>
Public Member Functions | |
DataStatus (const DataStatusType &status, std::string desc="") | |
Constructor to use when errno-like information is not available. More... | |
DataStatus (const DataStatusType &status, int error_no, const std::string &desc="") | |
Construct a new DataStatus with errno and optional text description. More... | |
DataStatus () | |
Construct a new DataStatus with fields initialised to success states. | |
bool | operator== (const DataStatusType &s) |
Returns true if this status type matches s. | |
bool | operator== (const DataStatus &s) |
Returns true if this status type matches the status type of s. | |
bool | operator!= (const DataStatusType &s) |
Returns true if this status type does not match s. | |
bool | operator!= (const DataStatus &s) |
Returns true if this status type does not match the status type of s. | |
DataStatus | operator= (const DataStatusType &s) |
Assignment operator. More... | |
bool | operator! () const |
Returns true if status type is not a success value. | |
operator bool () const | |
Returns true if status type is a success value. | |
bool | Passed () const |
Returns true if no error occurred. | |
bool | Retryable () const |
Returns true if the error was temporary and could be retried. More... | |
void | SetErrno (int error_no) |
Set the error number. | |
int | GetErrno () const |
Get the error number. | |
std::string | GetStrErrno () const |
Get text description of the error number. | |
void | SetDesc (const std::string &d) |
Set a detailed description of the status, removing trailing new line if present. | |
std::string | GetDesc () const |
Get a detailed description of the status. | |
operator std::string (void) const | |
Returns a human-friendly readable string with all error information. | |
Status code returned by many DataPoint methods.
A class to be used for return types of all major data handling methods. It describes the outcome of the method and contains three fields: DataStatusType describes in which operation the error occurred, Errno describes why the error occurred and desc gives more detail if available. Errno is an integer corresponding to error codes defined in errno.h plus additional ARC-specific error codes defined here.
For those DataPoints which natively support errno, it is safe to use code like
since logger.msg() does not call any system calls that modify errno.
Status codes.
These codes describe in which operation an error occurred. Retryable error codes are deprecated - the corresponding non-retryable error code should be used with errno set to a retryable value.
Enumerator | |
---|---|
Success |
Operation completed successfully. |
ReadAcquireError |
Source is bad URL or can't be used due to some reason. |
WriteAcquireError |
Destination is bad URL or can't be used due to some reason. |
ReadResolveError |
Resolving of index service URL for source failed. |
WriteResolveError |
Resolving of index service URL for destination failed. |
ReadStartError |
Can't read from source. |
WriteStartError |
Can't write to destination. |
ReadError |
Failed while reading from source. |
WriteError |
Failed while writing to destination. |
TransferError |
Failed while transfering data (mostly timeout) |
ReadStopError |
Failed while finishing reading from source. |
WriteStopError |
Failed while finishing writing to destination. |
PreRegisterError |
First stage of registration of index service URL failed. |
PostRegisterError |
Last stage of registration of index service URL failed. |
UnregisterError |
Unregistration of index service URL failed. |
CacheError |
Error in caching procedure. |
CredentialsExpiredError |
Error due to provided credentials are expired. |
DeleteError |
Error deleting location or URL. |
NoLocationError |
No valid location available. |
LocationAlreadyExistsError |
No valid location available. |
NotSupportedForDirectDataPointsError |
Operation has no sense for this kind of URL. |
UnimplementedError |
Feature is unimplemented. |
IsReadingError |
DataPoint is already reading. |
IsWritingError |
DataPoint is already writing. |
CheckError |
Access check failed. |
ListError |
Directory listing failed. |
ListNonDirError |
|
StatError |
File/dir stating failed. |
StatNotPresentError |
|
NotInitializedError |
Object initialization failed. |
SystemError |
Error in OS. |
StageError |
Staging error. |
InconsistentMetadataError |
Inconsistent metadata. |
ReadPrepareError |
Can't prepare source. |
ReadPrepareWait |
Wait for source to be prepared. |
WritePrepareError |
Can't prepare destination. |
WritePrepareWait |
Wait for destination to be prepared. |
ReadFinishError |
Can't finish source. |
WriteFinishError |
Can't finish destination. |
CreateDirectoryError |
Can't create directory. |
RenameError |
Can't rename URL. |
SuccessCached |
Data was already cached. |
SuccessCancelled |
Operation was cancelled successfully. |
GenericError |
General error which doesn't fit any other error. |
UnknownError |
Undefined. |
ReadAcquireErrorRetryable | |
WriteAcquireErrorRetryable | |
ReadResolveErrorRetryable | |
WriteResolveErrorRetryable | |
ReadStartErrorRetryable | |
WriteStartErrorRetryable | |
ReadErrorRetryable | |
WriteErrorRetryable | |
TransferErrorRetryable | |
ReadStopErrorRetryable | |
WriteStopErrorRetryable | |
PreRegisterErrorRetryable | |
PostRegisterErrorRetryable | |
UnregisterErrorRetryable | |
CacheErrorRetryable | |
DeleteErrorRetryable | |
CheckErrorRetryable | |
ListErrorRetryable | |
StatErrorRetryable | |
StageErrorRetryable | |
ReadPrepareErrorRetryable | |
WritePrepareErrorRetryable | |
ReadFinishErrorRetryable | |
WriteFinishErrorRetryable | |
CreateDirectoryErrorRetryable | |
RenameErrorRetryable | |
GenericErrorRetryable |
|
inline |
Constructor to use when errno-like information is not available.
status | error location |
desc | error description |
|
inline |
Construct a new DataStatus with errno and optional text description.
If the status is an error condition then error_no must be set to a non-zero value.
status | error location |
error_no | errno |
desc | error description |
|
inline |
Assignment operator.
Sets status type to s and errno to EARCOTHER if s is an error state.
bool Arc::DataStatus::Retryable | ( | ) | const |
Returns true if the error was temporary and could be retried.
Retryable error numbers are EAGAIN, EBUSY, ETIMEDOUT, EARCSVCTMP, EARCTRANSFERTIMEOUT, EARCCHECKSUM and EARCOTHER.