Skip to content

Commit 055e513

Browse files
committed
Added resolver_error.
1 parent d653b4b commit 055e513

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

http/src/http/v2/client/client_errors.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,33 @@ namespace network {
3636
return std::error_code(static_cast<int>(e), client_category());
3737
}
3838

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) {
4041

4142
}
4243

4344
invalid_scheme::~invalid_scheme() noexcept {
4445

4546
}
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+
4666
} // namespace v2
4767
} // namespace network
4868
} // namespace network

http/src/network/http/v2/client/client_errors.hpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ namespace network {
1616
// scheme
1717
invalid_scheme,
1818

19+
// resolution
20+
resolver_error,
21+
1922
// connection
20-
connnection_timeout
23+
connection_timeout,
2124
};
2225

2326
class client_category_impl : public std::error_category {
@@ -42,17 +45,28 @@ namespace network {
4245

4346
public:
4447

45-
invalid_scheme(const std::string &scheme);
48+
explicit invalid_scheme(const std::string &scheme);
4649

4750
virtual ~invalid_scheme() noexcept;
4851

4952
};
5053

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+
5165
class connection_timeout : public std::system_error {
5266

5367
public:
5468

55-
connection_timeout() = default;
69+
connection_timeout();
5670

5771
virtual ~connection_timeout() noexcept;
5872

0 commit comments

Comments
 (0)