Commits

Anonymous committed 63c3846 Draft

cope with error during sending

  • Participants
  • Parent commits f1381fe

Comments (0)

Files changed (1)

File araldo/router.py

     def route(self, origin, message):
         """ Send message via all configured outgoing endpoints
         """
+        #self._log.debug(
+        #    "_routes: %s, _outbound: %s",
+        #    self._routes, self._outbound)
         route = self._routes.get(origin, None)
         if route is None:
             self._log.debug(
                         "Destination '%s' not found; not routing",
                         destination)
                     continue
-                self._outbound[destination].send(str(message))
+                try:
+                    self._outbound[destination].send(str(message))
+                except Exception as error:
+                    self._log.error(
+                        "Exception while sending message to %s: %s",
+                        destination, error)
                 gevent.sleep(0)