Ejemplo n.º 1
0
 def _check(self, err):
     if err < 0:
         exc = EXCEPTIONS.get(err, MessageException)
         raise exc("[%s]: %s" %
                   (err, pn_error_text(pn_message_error(self._msg))))
     else:
         return err
Ejemplo n.º 2
0
 def _check(self, err):
     if err < 0:
         exc = EXCEPTIONS.get(err, TransportException)
         raise exc("[%s]: %s" %
                   (err, pn_error_text(pn_transport_error(self._impl))))
     else:
         return err
Ejemplo n.º 3
0
 def _check(self, err):
     if err < 0:
         exc = EXCEPTIONS.get(err, DataException)
         raise exc("[%s]: %s" %
                   (err, pn_error_text(pn_data_error(self._data))))
     else:
         return err
Ejemplo n.º 4
0
 def acceptor(self, host, port, handler=None):
     impl = _chandler(handler, self.on_error_delegate())
     aimpl = pn_reactor_acceptor(self._impl, unicode2utf8(host), str(port), impl)
     pn_decref(impl)
     if aimpl:
         return Acceptor(aimpl)
     else:
         raise IOError("%s (%s:%s)" % (pn_error_text(pn_reactor_error(self._impl)), host, port))
Ejemplo n.º 5
0
 def acceptor(self, host, port, handler=None):
     impl = _chandler(handler, self.on_error_delegate())
     aimpl = pn_reactor_acceptor(self._impl, unicode2utf8(host), str(port), impl)
     pn_decref(impl)
     if aimpl:
         return Acceptor(aimpl)
     else:
         raise IOError("%s (%s:%s)" % (pn_error_text(pn_reactor_error(self._impl)), host, port))
Ejemplo n.º 6
0
 def wakeup(self):
     n = pn_reactor_wakeup(self._impl)
     if n: raise IOError(pn_error_text(pn_reactor_error(self._impl)))
Ejemplo n.º 7
0
 def _check(self, err):
     if err < 0:
         exc = EXCEPTIONS.get(err, LinkException)
         raise exc("[%s]: %s" % (err, pn_error_text(pn_link_error(self._impl))))
     else:
         return err
Ejemplo n.º 8
0
 def _check(self, err):
     if err < 0:
         exc = EXCEPTIONS.get(err, MessageException)
         raise exc("[%s]: %s" % (err, pn_error_text(pn_message_error(self._msg))))
     else:
         return err
Ejemplo n.º 9
0
 def wakeup(self):
     n = pn_reactor_wakeup(self._impl)
     if n: raise IOError(pn_error_text(pn_reactor_error(self._impl)))
Ejemplo n.º 10
0
 def _check(self, err):
     if err < 0:
         exc = EXCEPTIONS.get(err, DataException)
         raise exc("[%s]: %s" % (err, pn_error_text(pn_data_error(self._data))))
     else:
         return err