From: Mikko Rasa Date: Wed, 10 Aug 2011 18:03:38 +0000 (+0300) Subject: Pass an exception to signal_socket_error instead of error code X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=1c965907682f4714db7b952915cf5b6bf9b7f4c1;p=libs%2Fnet.git Pass an exception to signal_socket_error instead of error code --- diff --git a/source/client.cpp b/source/client.cpp index 48cd291..0729544 100644 --- a/source/client.cpp +++ b/source/client.cpp @@ -105,7 +105,7 @@ void Client::abort() request = 0; } -void Client::connect_finished(int err) +void Client::connect_finished(const exception *err) { if(err) { @@ -126,9 +126,9 @@ void Client::data_available() { len = sock->read(rbuf, sizeof(rbuf)); } - catch(const SystemError &e) + catch(const exception &e) { - signal_socket_error.emit(e.get_error_code()); + signal_socket_error.emit(&e); return; } diff --git a/source/client.h b/source/client.h index b27109c..ee10f8c 100644 --- a/source/client.h +++ b/source/client.h @@ -16,7 +16,7 @@ class Client { public: sigc::signal signal_response_complete; - sigc::signal signal_socket_error; + sigc::signal signal_socket_error; private: Net::StreamSocket *sock; @@ -42,7 +42,7 @@ public: const Request *get_request() const { return request; } const Response *get_response() const { return response; } private: - void connect_finished(int); + void connect_finished(const std::exception *); void data_available(); };