ZMQII-41: Poll function in C++ binding doesn't convert errors to exceptions

This commit is contained in:
Martin Sustrik 2010-01-20 09:19:03 +01:00
parent 6b0457fcaa
commit 111f0ff078

View File

@ -35,7 +35,10 @@ namespace zmq
inline int poll (zmq_pollitem_t *items_, int nitems_, long timeout_ = -1) inline int poll (zmq_pollitem_t *items_, int nitems_, long timeout_ = -1)
{ {
return zmq_poll (items_, nitems_, timeout_); int rc = zmq_poll (items_, nitems_, timeout_);
if (rc < 0)
throw error_t ();
return rc;
} }
class error_t : public std::exception class error_t : public std::exception