File tree Expand file tree Collapse file tree 2 files changed +38
-4
lines changed Expand file tree Collapse file tree 2 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,33 @@ namespace network {
36
36
return std::error_code (static_cast <int >(e), client_category ());
37
37
}
38
38
39
- invalid_scheme::invalid_scheme (const std::string &scheme) {
39
+ invalid_scheme::invalid_scheme (const std::string &scheme)
40
+ : std::system_error(make_error_code(client_error::invalid_scheme), " Invalid scheme: " + scheme) {
40
41
41
42
}
42
43
43
44
invalid_scheme::~invalid_scheme () noexcept {
44
45
45
46
}
47
+
48
+ resolver_error::resolver_error (const std::string &msg)
49
+ : std::system_error(make_error_code(client_error::resolver_error), msg) {
50
+
51
+ }
52
+
53
+ resolver_error::~resolver_error () {
54
+
55
+ }
56
+
57
+ connection_timeout::connection_timeout ()
58
+ : std::system_error(make_error_code(client_error::connection_timeout)) {
59
+
60
+ }
61
+
62
+ connection_timeout::~connection_timeout () {
63
+
64
+ }
65
+
46
66
} // namespace v2
47
67
} // namespace network
48
68
} // namespace network
Original file line number Diff line number Diff line change @@ -16,8 +16,11 @@ namespace network {
16
16
// scheme
17
17
invalid_scheme,
18
18
19
+ // resolution
20
+ resolver_error,
21
+
19
22
// connection
20
- connnection_timeout
23
+ connection_timeout,
21
24
};
22
25
23
26
class client_category_impl : public std ::error_category {
@@ -42,17 +45,28 @@ namespace network {
42
45
43
46
public:
44
47
45
- invalid_scheme (const std::string &scheme);
48
+ explicit invalid_scheme (const std::string &scheme);
46
49
47
50
virtual ~invalid_scheme () noexcept ;
48
51
49
52
};
50
53
54
+
55
+ class resolver_error : std::system_error {
56
+
57
+ public:
58
+
59
+ explicit resolver_error (const std::string &msg);
60
+
61
+ virtual ~resolver_error () noexcept ;
62
+
63
+ };
64
+
51
65
class connection_timeout : public std ::system_error {
52
66
53
67
public:
54
68
55
- connection_timeout () = default ;
69
+ connection_timeout ();
56
70
57
71
virtual ~connection_timeout () noexcept ;
58
72
You can’t perform that action at this time.
0 commit comments