9 #include <boost/system/error_code.hpp> 28 DPY_NOT_PERMITTED = 11,
30 DPY_BAD_PARAMETER = 13,
34 DPY_NOT_IMPLEMENTED = 17,
36 DPY_COULD_NOT_OBTAIN_VALUE = 19,
37 DPY_EMPTY_MESSAGE = 20,
39 DPY_COMMAND_ERROR = 22,
40 DPY_INVALID_VALUE = 23,
42 DPY_CONFIG_ERROR = 25,
44 DPY_INVALID_CHECKSUM = 27,
45 DPY_REQUEST_PROCESSED = 28,
46 DPY_REQUEST_DEFERRED = 29,
49 DPY_FILE_COULD_NOT_BE_OPENED = 30,
50 DPY_FILE_DOES_NOT_EXIST = 31,
51 DPY_FILE_CORRUPTED = 32,
52 DPY_FILE_JSON_PARSE_ERROR = 33,
55 DPY_PORT_OPEN_ERROR = 40,
56 DPY_PORT_CLOSE_ERROR = 41,
57 DPY_PORT_OPEN_LOCK_ERROR = 42,
65 #define ERROR_PARSE {ec=DPY_FILE_JSON_PARSE_ERROR;return false;} 75 class dpyError:
public boost::system::error_category
82 virtual const char *
name() const noexcept
95 return "Successful operation.";
97 return "Referenced item does not exist or could not be found.";
98 case DPY_FORMAT_ERROR:
99 return "Format obtained does not meet the expected requirements";
101 return "An overflow occurred or would have occurred.";
102 case DPY_UNAVAILABLE:
103 return "A transient or temporary loss of a service or resource.";
105 return "The process, operation, data stream, session, etc. has stopped.";
107 return "An IO operation failed.";
109 return "Communications error.";
111 return "A time-out occurred.";
112 case DPY_OUT_OF_RANGE:
113 return "An index or other value is out of range.";
115 return "Insufficient memory is available.";
116 case DPY_NOT_PERMITTED:
117 return "Requested action not permitted.";
119 return "Duplicate entry found or operation already performed.";
120 case DPY_BAD_PARAMETER:
121 return "Invalid parameter (out of range or invalid type).";
123 return "The resource is closed.";
125 return "The resource is busy.";
126 case DPY_UNSUPPORTED:
127 return "The underlying resource does not support this operation.";
128 case DPY_NOT_IMPLEMENTED:
129 return "Unimplemented functionality.";
131 return "Call has no effect.";
132 case DPY_COULD_NOT_OBTAIN_VALUE:
133 return "The value could not be obtained";
134 case DPY_EMPTY_MESSAGE:
135 return "The message is empty";
136 case DPY_PARSE_ERROR:
137 return "There was an error during parsing";
138 case DPY_COMMAND_ERROR:
139 return "Expected command response could not be received";
140 case DPY_INVALID_VALUE:
141 return "The value requested is not valid";
143 return "The operation requested is missing one or more parameters";
144 case DPY_CONFIG_ERROR:
145 return "Configuration error occurred";
147 return "The requested service is not ready yet";
148 case DPY_INVALID_CHECKSUM:
149 return "Checksum calculation has thrown an error";
150 case DPY_REQUEST_PROCESSED:
151 return "The request was processed but the result of the operation can't be known";
152 case DPY_REQUEST_DEFERRED:
153 return "The request was received and will be processed as soon as possible ";
154 case DPY_FILE_COULD_NOT_BE_OPENED:
155 return "File could not be opened.";
156 case DPY_FILE_DOES_NOT_EXIST:
157 return "File does not exist";
158 case DPY_FILE_CORRUPTED:
159 return "File is corrupted";
160 case DPY_FILE_JSON_PARSE_ERROR:
161 return "The json file could not be parsed";
162 case DPY_PORT_OPEN_ERROR:
163 return "Could not open the port";
164 case DPY_PORT_CLOSE_ERROR:
165 return "Could not close the port";
166 case DPY_PORT_OPEN_LOCK_ERROR:
167 return "Could not open the port, it is locked by another application";
169 return "Exception occurred while performing operation";
171 return "unknown custom::category error";
173 return "unknown custom::category error";
177 inline const boost::system::error_category& get_dpy_error_category();
178 static const boost::system::error_category& dpy_error_category = get_dpy_error_category();
180 const boost::system::error_category& get_dpy_error_category()
187 inline boost::system::error_code make_error_code(dpy_errors e)
189 return boost::system::error_code(static_cast<int>(e), dpy_error_category);
200 struct is_error_code_enum<dpy_errors>
205 BOOST_STATIC_CONSTANT(
bool, value =
true);
Definition: dpyError.h:192
virtual const char * name() const noexcept
Returns the name of the category.
Definition: dpyError.h:82
Allows to categorize the errors.
Definition: dpyError.h:75
virtual std::string message(int e) const
Return the error message according to the error value.
Definition: dpyError.h:91