File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,7 @@ namespace network {
35
35
36
36
std::string client_category_impl::message (int ev) const {
37
37
switch (client_error (ev)) {
38
- case client_error::invalid_url:
39
- return " Requires HTTP or HTTPS URL." ;
38
+
40
39
case client_error::invalid_request:
41
40
return " Invalid HTTP request." ;
42
41
case client_error::host_not_found:
@@ -59,7 +58,7 @@ namespace network {
59
58
}
60
59
61
60
invalid_url::invalid_url ()
62
- : std::system_error(make_error_code(client_error::invalid_url) ) {
61
+ : std::invalid_argument( " Requires HTTP or HTTPS URL. " ) {
63
62
64
63
}
65
64
Original file line number Diff line number Diff line change 12
12
* clients.
13
13
*/
14
14
15
- #include < network/config.hpp>
16
15
#include < system_error>
16
+ #include < stdexcept>
17
+ #include < network/config.hpp>
17
18
18
19
namespace network {
19
20
namespace http {
@@ -24,9 +25,6 @@ namespace network {
24
25
* \brief An enumeration of all types of client error.
25
26
*/
26
27
enum class client_error {
27
- // url
28
- invalid_url,
29
-
30
28
// request
31
29
invalid_request,
32
30
@@ -52,7 +50,7 @@ namespace network {
52
50
* \class invalid_url network/http/v2/client/client_errors.hpp network/http/v2/client.hpp
53
51
* \brief An exception thrown if the URL provides is invalid.
54
52
*/
55
- class invalid_url : public std ::system_error {
53
+ class invalid_url : public std ::invalid_argument {
56
54
57
55
public:
58
56
You can’t perform that action at this time.
0 commit comments