Exemple #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
Exemple #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
Exemple #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
Exemple #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))
 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))
Exemple #6
0
 def wakeup(self):
     n = pn_reactor_wakeup(self._impl)
     if n: raise IOError(pn_error_text(pn_reactor_error(self._impl)))
Exemple #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
Exemple #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
 def wakeup(self):
     n = pn_reactor_wakeup(self._impl)
     if n: raise IOError(pn_error_text(pn_reactor_error(self._impl)))
Exemple #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