13 #ifndef HERMES_STATUS_H_
14 #define HERMES_STATUS_H_
22 #define RETURN_CODES(X) \
24 "Maximum supported HERMES success with " \
26 X(1, BLOB_IN_SWAP_PLACE, "Blob is placed into swap place.") \
27 X(0, HERMES_SUCCESS, "No error!") \
28 X(-1, INVALID_BUCKET, "Bucket ID is invalid.") \
29 X(-2, BUCKET_NAME_TOO_LONG, "Bucket name exceeds max length (256).") \
30 X(-3, VBUCKET_NAME_TOO_LONG, "VBucket name exceeds max length (256).") \
31 X(-4, BLOB_NAME_TOO_LONG, "Blob name exceeds max length (64).") \
33 "Blob data is invalid. Please check " \
34 "address and size.") \
35 X(-6, BLOB_NOT_IN_BUCKET, "Blob is not in this bucket.") \
36 X(-7, BLOB_NOT_LINKED_TO_VBUCKET, "Blob is not linked to this vbucket.") \
37 X(-8, TRAIT_NOT_VALID, "Selected trait is not valid.") \
38 X(-9, TRAIT_EXISTS_ALREADY, "Selected trait already exists.") \
39 X(-10, OFFSET_MAP_EMPTY, "Offset_map is empty.") \
40 X(-11, BLOB_NOT_LINKED_IN_MAP, "Map doesn't have the blob linked.") \
41 X(-12, BUCKET_IN_USE, \
42 "Bucket cannot be destroyed because its " \
43 "reference count is greater than 1.") \
44 X(-13, DPE_RANDOM_FOUND_NO_TGT, \
45 "DPE random found no target with enough " \
47 X(-14, DPE_GET_INVALID_TGT, "DPE got an invalid target ID.") \
48 X(-15, DPE_ORTOOLS_NO_SOLUTION, \
49 "DPE GLPK does not find a solution " \
50 "with provided constraints.") \
51 X(-16, DPE_PLACEMENTSCHEMA_EMPTY, "DPE PlacementSchema is empty.") \
52 X(-17, READ_BLOB_FAILED, "Read blob from its id failed.") \
53 X(-18, STDIO_OFFSET_ERROR, "Offset invalid or fseek() failed.") \
54 X(-19, STDIO_FWRITE_FAILED, "Func fwrite failed. System err msg: ") \
55 X(-20, STDIO_FOPEN_FAILED, "Func fopen failed. System err msg: ") \
56 X(-21, STDIO_FCLOSE_FAILED, "Func fclose failed. System err msg: ") \
57 X(-23, INVALID_FILE, "File is not valid.") \
58 X(-24, PLACE_SWAP_BLOB_TO_BUF_FAILED, \
59 "Place blob from swap space into " \
60 "buffering system failed.") \
61 X(-25, DPE_RR_FIND_TGT_FAILED, \
62 "DPE round-robin failed to find " \
63 "proper target for blob.") \
64 X(-26, HERMES_ERROR_MAX, "Maximum supported HERMES errors.")
67 #define RETURN_ENUM(ID, NAME, TEXT) NAME = ID,
70 #define RETURN_TEXT(ID, NAME, TEXT) \
95 return (status_ < HERMES_SUCCESS && status_ > HERMES_ERROR_MAX);
111 return "Unknown error";
Definition: hermes_status.h:80
bool Succeeded() const
Definition: hermes_status.h:86
StatusCode GetStatus() const
Definition: hermes_status.h:105
bool Acceptable() const
Definition: hermes_status.h:89
bool Failed() const
Definition: hermes_status.h:94
Status(StatusCode ret_code=HERMES_SUCCESS)
Definition: hermes_status.h:83
void operator=(StatusCode code)
Definition: hermes_status.h:102
std::string Msg() const
Definition: hermes_status.h:108
bool operator==(StatusCode code)
Definition: hermes_status.h:99
#define RETURN_TEXT(ID, NAME, TEXT)
Definition: hermes_status.h:70
StatusCode status_
Definition: hermes_status.h:115
#define RETURN_CODES(X)
Definition: hermes_status.h:22
#define RETURN_ENUM(ID, NAME, TEXT)
Definition: hermes_status.h:67
Definition: adapter_utils.cc:35
StatusCode
Definition: hermes_status.h:75