From 111f0ff078372e8a0f5c0b98170d451d6561e85e Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 20 Jan 2010 09:19:03 +0100 Subject: ZMQII-41: Poll function in C++ binding doesn't convert errors to exceptions --- bindings/cpp/zmq.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bindings/cpp/zmq.hpp b/bindings/cpp/zmq.hpp index a572c69..0afeff0 100644 --- a/bindings/cpp/zmq.hpp +++ b/bindings/cpp/zmq.hpp @@ -35,7 +35,10 @@ namespace zmq 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 -- cgit v1.2.3