diff options
author | Jack Lloyd <[email protected]> | 2015-12-19 16:09:17 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-12-19 16:09:17 -0500 |
commit | 0fae1884079518e4f6d1c049cc7f341cd96c8a65 (patch) | |
tree | 41e3a8aea10b7381c0e2cfd4ee019745215876ac /src/cli/tls_server.cpp | |
parent | b3da432772628fdb3eed9cf5dabb54eda0097d2b (diff) |
Remove all remaining uses of throwing a std:: exception directly
See GH #340 and 6b9a3a5 for background
Diffstat (limited to 'src/cli/tls_server.cpp')
-rw-r--r-- | src/cli/tls_server.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cli/tls_server.cpp b/src/cli/tls_server.cpp index 6a5b4e812..f6a3a311e 100644 --- a/src/cli/tls_server.cpp +++ b/src/cli/tls_server.cpp @@ -79,10 +79,10 @@ class TLS_Server : public Command if(::recvfrom(server_fd, nullptr, 0, MSG_PEEK, (struct sockaddr*)&from, &from_len) != 0) - throw std::runtime_error("Could not peek next packet"); + throw CLI_Error("Could not peek next packet"); if(::connect(server_fd, (struct sockaddr*)&from, from_len) != 0) - throw std::runtime_error("Could not connect UDP socket"); + throw CLI_Error("Could not connect UDP socket"); fd = server_fd; } @@ -161,7 +161,7 @@ class TLS_Server : public Command int fd = ::socket(PF_INET, type, 0); if(fd == -1) - throw std::runtime_error("Unable to acquire socket"); + throw CLI_Error("Unable to acquire socket"); sockaddr_in socket_info; ::memset(&socket_info, 0, sizeof(socket_info)); @@ -174,7 +174,7 @@ class TLS_Server : public Command if(::bind(fd, (sockaddr*)&socket_info, sizeof(struct sockaddr)) != 0) { ::close(fd); - throw std::runtime_error("server bind failed"); + throw CLI_Error("server bind failed"); } if(is_tcp) @@ -182,7 +182,7 @@ class TLS_Server : public Command if(::listen(fd, 100) != 0) { ::close(fd); - throw std::runtime_error("listen failed"); + throw CLI_Error("listen failed"); } } @@ -224,7 +224,7 @@ class TLS_Server : public Command if(errno == EINTR) sent = 0; else - throw std::runtime_error("Socket write failed"); + throw CLI_Error("Socket write failed"); } buf += sent; |