-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.hpp
64 lines (43 loc) · 919 Bytes
/
error.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef DS_MQTT_BRIDGE_ERROR_HPP
#define DS_MQTT_BRIDGE_ERROR_HPP
#include <system_error>
#include <type_traits>
namespace dsmq {
/**
* enum class dsmq_errc
*/
enum class dsmq_errc : int
{
not_ok,
exception,
server_error,
protocol_violation,
timeout
};
/**
* function dsmq_category
*/
namespace detail {
class dsmq_category
: public std::error_category
{
public:
char const* name() const noexcept override { return "prnet::prnet_category"; }
std::string message( int value ) const override;
};
} // namespace detail
std::error_category const& dsmq_category();
/**
* function make_error_code
*/
std::error_code make_error_code( dsmq_errc e );
} // namespace prnet
/**
* namespace std hooks
*/
namespace std {
template<>
struct is_error_code_enum< dsmq::dsmq_errc >
: public std::true_type {};
} // namespace std
#endif // DS_MQTT_BRIDGE_ERROR_HPP