Mercurial > irccd
comparison irccdctl/cli.cpp @ 542:80c3caafe9d3
Common: rename network_error to network_errc
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 21 Nov 2017 12:29:50 +0100 |
parents | 9daccaeedcce |
children | 7051034bf2ee |
comparison
equal
deleted
inserted
replaced
541:1c2598716ffc | 542:80c3caafe9d3 |
---|---|
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
17 */ | 17 */ |
18 | 18 |
19 #include <boost/system/system_error.hpp> | 19 #include <boost/system/system_error.hpp> |
20 | 20 |
21 #include <irccd/errors.hpp> | |
22 #include <irccd/json_util.hpp> | 21 #include <irccd/json_util.hpp> |
22 #include <irccd/network_errc.hpp> | |
23 #include <irccd/options.hpp> | 23 #include <irccd/options.hpp> |
24 #include <irccd/string_util.hpp> | 24 #include <irccd/string_util.hpp> |
25 | 25 |
26 #include <irccd/ctl/controller.hpp> | 26 #include <irccd/ctl/controller.hpp> |
27 | 27 |
43 recv_response(ctl, std::move(req), std::move(handler)); | 43 recv_response(ctl, std::move(req), std::move(handler)); |
44 return; | 44 return; |
45 } | 45 } |
46 | 46 |
47 if (message["error"].is_number_integer()) | 47 if (message["error"].is_number_integer()) |
48 throw boost::system::system_error(static_cast<network_error>(message["error"].template get<int>())); | 48 throw boost::system::system_error(static_cast<network_errc>(message["error"].template get<int>())); |
49 if (message["error"].is_string()) | 49 if (message["error"].is_string()) |
50 throw std::runtime_error(message["error"].template get<std::string>()); | 50 throw std::runtime_error(message["error"].template get<std::string>()); |
51 | 51 |
52 if (handler) | 52 if (handler) |
53 handler(std::move(message)); | 53 handler(std::move(message)); |