Loading...
Searching...
No Matches
exception.h
1
5#pragma once
6
7#include <exception>
8#include <string>
9#include <utility>
10
11namespace ucxx {
12
18class Error : public std::exception {
19 private:
20 std::string _msg{};
21
22 public:
30 explicit Error(const std::string& msg) : _msg{std::move(msg)} {}
31
39 const char* what() const noexcept override { return this->_msg.c_str(); }
40};
41
47class NoMessageError : public Error {
48 public:
56 explicit NoMessageError(const std::string& msg) : Error(msg) {}
57};
58
64class NoResourceError : public Error {
65 public:
73 explicit NoResourceError(const std::string& msg) : Error(msg) {}
74};
75
81class IOError : public Error {
82 public:
90 explicit IOError(const std::string& msg) : Error(msg) {}
91};
92
98class NoMemoryError : public Error {
99 public:
107 explicit NoMemoryError(const std::string& msg) : Error(msg) {}
108};
109
115class InvalidParamError : public Error {
116 public:
124 explicit InvalidParamError(const std::string& msg) : Error(msg) {}
125};
126
132class UnreachableError : public Error {
133 public:
141 explicit UnreachableError(const std::string& msg) : Error(msg) {}
142};
143
149class InvalidAddrError : public Error {
150 public:
158 explicit InvalidAddrError(const std::string& msg) : Error(msg) {}
159};
160
167 public:
175 explicit NotImplementedError(const std::string& msg) : Error(msg) {}
176};
177
184 public:
192 explicit MessageTruncatedError(const std::string& msg) : Error(msg) {}
193};
194
200class NoProgressError : public Error {
201 public:
209 explicit NoProgressError(const std::string& msg) : Error(msg) {}
210};
211
218 public:
226 explicit BufferTooSmallError(const std::string& msg) : Error(msg) {}
227};
228
234class NoElemError : public Error {
235 public:
243 explicit NoElemError(const std::string& msg) : Error(msg) {}
244};
245
252 public:
260 explicit SomeConnectsFailedError(const std::string& msg) : Error(msg) {}
261};
262
268class NoDeviceError : public Error {
269 public:
277 explicit NoDeviceError(const std::string& msg) : Error(msg) {}
278};
279
285class BusyError : public Error {
286 public:
294 explicit BusyError(const std::string& msg) : Error(msg) {}
295};
296
302class CanceledError : public Error {
303 public:
311 explicit CanceledError(const std::string& msg) : Error(msg) {}
312};
313
319class ShmemSegmentError : public Error {
320 public:
328 explicit ShmemSegmentError(const std::string& msg) : Error(msg) {}
329};
330
336class AlreadyExistsError : public Error {
337 public:
345 explicit AlreadyExistsError(const std::string& msg) : Error(msg) {}
346};
347
353class OutOfRangeError : public Error {
354 public:
362 explicit OutOfRangeError(const std::string& msg) : Error(msg) {}
363};
364
370class TimedOutError : public Error {
371 public:
379 explicit TimedOutError(const std::string& msg) : Error(msg) {}
380};
381
387class ExceedsLimitError : public Error {
388 public:
396 explicit ExceedsLimitError(const std::string& msg) : Error(msg) {}
397};
398
404class UnsupportedError : public Error {
405 public:
413 explicit UnsupportedError(const std::string& msg) : Error(msg) {}
414};
415
421class RejectedError : public Error {
422 public:
430 explicit RejectedError(const std::string& msg) : Error(msg) {}
431};
432
438class NotConnectedError : public Error {
439 public:
447 explicit NotConnectedError(const std::string& msg) : Error(msg) {}
448};
449
456 public:
464 explicit ConnectionResetError(const std::string& msg) : Error(msg) {}
465};
466
473 public:
481 explicit FirstLinkFailureError(const std::string& msg) : Error(msg) {}
482};
483
490 public:
498 explicit LastLinkFailureError(const std::string& msg) : Error(msg) {}
499};
500
507 public:
515 explicit FirstEndpointFailureError(const std::string& msg) : Error(msg) {}
516};
517
524 public:
532 explicit EndpointTimeoutError(const std::string& msg) : Error(msg) {}
533};
534
541 public:
549 explicit LastEndpointFailureError(const std::string& msg) : Error(msg) {}
550};
551
552} // namespace ucxx
AlreadyExistsError(const std::string &msg)
The UCS_ERR_ALREADY_EXISTS constructor.
Definition exception.h:345
BufferTooSmallError(const std::string &msg)
The UCS_ERR_BUFFER_TOO_SMALL constructor.
Definition exception.h:226
BusyError(const std::string &msg)
The UCS_ERR_BUSY constructor.
Definition exception.h:294
CanceledError(const std::string &msg)
The UCS_ERR_CANCELED constructor.
Definition exception.h:311
ConnectionResetError(const std::string &msg)
The UCS_ERR_CONNECTION_RESET constructor.
Definition exception.h:464
EndpointTimeoutError(const std::string &msg)
The UCS_ERR_ENDPOINT_TIMEOUT constructor.
Definition exception.h:532
const char * what() const noexcept override
Returns an explanatory string.
Definition exception.h:39
Error(const std::string &msg)
The base class constructor.
Definition exception.h:30
ExceedsLimitError(const std::string &msg)
The UCS_ERR_EXCEEDS_LIMIT constructor.
Definition exception.h:396
FirstEndpointFailureError(const std::string &msg)
The UCS_ERR_FIRST_ENDPOINT_FAILURE constructor.
Definition exception.h:515
FirstLinkFailureError(const std::string &msg)
The UCS_ERR_FIRST_LINK_FAILURE constructor.
Definition exception.h:481
IOError(const std::string &msg)
The UCS_ERR_IO_ERROR constructor.
Definition exception.h:90
InvalidAddrError(const std::string &msg)
The UCS_ERR_INVALID_ADDR constructor.
Definition exception.h:158
InvalidParamError(const std::string &msg)
The UCS_ERR_INVALID_PARAM constructor.
Definition exception.h:124
LastEndpointFailureError(const std::string &msg)
The UCS_ERR_LAST_ENDPOINT_FAILURE constructor.
Definition exception.h:549
LastLinkFailureError(const std::string &msg)
The UCS_ERR_LAST_LINK_FAILURE constructor.
Definition exception.h:498
MessageTruncatedError(const std::string &msg)
The UCS_ERR_MESSAGE_TRUNCATED constructor.
Definition exception.h:192
NoDeviceError(const std::string &msg)
The UCS_ERR_NO_DEVICE constructor.
Definition exception.h:277
NoElemError(const std::string &msg)
The UCS_ERR_NO_ELEM constructor.
Definition exception.h:243
NoMemoryError(const std::string &msg)
The UCS_ERR_NO_MEMORY constructor.
Definition exception.h:107
NoMessageError(const std::string &msg)
The UCS_ERR_NO_MESSAGE constructor.
Definition exception.h:56
NoProgressError(const std::string &msg)
The UCS_ERR_NO_PROGRESS constructor.
Definition exception.h:209
NoResourceError(const std::string &msg)
The UCS_ERR_NO_RESOURCE constructor.
Definition exception.h:73
NotConnectedError(const std::string &msg)
The UCS_ERR_NOT_CONNECTED constructor.
Definition exception.h:447
NotImplementedError(const std::string &msg)
The UCS_ERR_NOT_IMPLEMENTED constructor.
Definition exception.h:175
OutOfRangeError(const std::string &msg)
The UCS_ERR_OUT_OF_RANGE constructor.
Definition exception.h:362
RejectedError(const std::string &msg)
The UCS_ERR_REJECTED constructor.
Definition exception.h:430
ShmemSegmentError(const std::string &msg)
The UCS_ERR_SHMEM_SEGMENT constructor.
Definition exception.h:328
SomeConnectsFailedError(const std::string &msg)
The UCS_ERR_SOME_CONNECTS_FAILED constructor.
Definition exception.h:260
TimedOutError(const std::string &msg)
The UCS_ERR_TIMED_OUT constructor.
Definition exception.h:379
UnreachableError(const std::string &msg)
The UCS_ERR_UNREACHABLE constructor.
Definition exception.h:141
UnsupportedError(const std::string &msg)
The UCS_ERR_UNSUPPORTED constructor.
Definition exception.h:413
Definition address.h:16