]> git.tdb.fi Git - libs/net.git/commitdiff
Pass an exception to signal_socket_error instead of error code
authorMikko Rasa <tdb@tdb.fi>
Wed, 10 Aug 2011 18:03:38 +0000 (21:03 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 10 Aug 2011 18:03:38 +0000 (21:03 +0300)
source/client.cpp
source/client.h

index 48cd291664b26ad659aff9919f028311e5d48f4d..0729544a7ce0686754f721e8e6dee3e30cd7c40e 100644 (file)
@@ -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;
        }
 
index b27109cd9b9ab60fb744e416a3990eefebfe6a9a..ee10f8c1cb5a0e389d860c6b9c59ee6a45aeb9a4 100644 (file)
@@ -16,7 +16,7 @@ class Client
 {
 public:
        sigc::signal<void, const Response &> signal_response_complete;
-       sigc::signal<void, int> signal_socket_error;
+       sigc::signal<void, const std::exception *> 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();
 };