Skip to content

Commit 2076fba

Browse files
committed
Removed internal exception in favor of standard one
1 parent ded7599 commit 2076fba

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/httpserver/webserver.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,6 @@ namespace details {
6565
class comet_manager;
6666
}
6767

68-
class webserver_exception : public std::runtime_error
69-
{
70-
public:
71-
webserver_exception()
72-
: std::runtime_error("httpserver runtime error")
73-
{
74-
}
75-
};
76-
7768
/**
7869
* Class representing the webserver. Main class of the apis.
7970
**/

src/webserver.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,7 @@ bool webserver::start(bool blocking)
296296
iov.push_back(gen(MHD_OPTION_LISTEN_SOCKET, bind_socket));
297297
if(start_method == http_utils::THREAD_PER_CONNECTION && max_threads != 0)
298298
{
299-
cout << "Cannot specify maximum number of threads when using a thread per connection" << endl;
300-
throw ::httpserver::webserver_exception();
299+
throw std::invalid_argument("Cannot specify maximum number of threads when using a thread per connection");
301300
}
302301

303302
if(max_threads != 0)
@@ -381,9 +380,7 @@ bool webserver::start(bool blocking)
381380

382381
if(NULL == daemon)
383382
{
384-
cout << gettext("Unable to connect daemon to port: ") <<
385-
this->port << endl;
386-
throw ::httpserver::webserver_exception();
383+
throw std::invalid_argument("Unable to connect daemon to port: " + this->port);
387384
}
388385
details::daemon_item* di = new details::daemon_item(this, daemon);
389386
daemons.push_back(di);

0 commit comments

Comments
 (0)