]> git.tdb.fi Git - libs/net.git/commitdiff
One more exception change
authorMikko Rasa <tdb@tdb.fi>
Wed, 10 Aug 2011 18:41:09 +0000 (21:41 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 10 Aug 2011 18:41:09 +0000 (21:41 +0300)
source/http/client.cpp
source/http/client.h

index 0729544a7ce0686754f721e8e6dee3e30cd7c40e..3d14b04e59d45b22889d8c699eab428829a16ea5 100644 (file)
@@ -1,4 +1,3 @@
-#include <msp/core/except.h>
 #include <msp/core/refptr.h>
 #include <msp/net/resolve.h>
 #include <msp/time/units.h>
@@ -38,7 +37,7 @@ void Client::use_event_dispatcher(IO::EventDispatcher *ed)
 void Client::start_request(const Request &r)
 {
        if(request)
-               throw InvalidState("Already processing a request");
+               throw client_busy();
 
        string host = r.get_header("Host");
        if(host.find(':')==string::npos)
index ee10f8c1cb5a0e389d860c6b9c59ee6a45aeb9a4..c8b154c728f56627c96454b42de767835f602246 100644 (file)
@@ -9,6 +9,13 @@
 namespace Msp {
 namespace Http {
 
+class client_busy: public std::logic_error
+{
+public:
+       client_busy(): std::logic_error(std::string()) { }
+       virtual ~client_busy() throw() { }
+};
+
 class Request;
 class Response;