Author tomMoral
Recipients davin, grzgrzgrz3, pitrou, tomMoral, xiang.zhang
Date 2017-06-04.08:59:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496566774.99.0.337618634577.issue30414@psf.upfronthosting.co.za>
In-reply-to
Content
I think this is a good solution as it let the user define easily the behavior it needs in other situation too. I would recommend adding the object responsible for the failure to the _on_queue_thread_error callback. This would simplify the error handling.


@@ -260,8 +260,16 @@ class Queue(object):
                     info('error in queue thread: %s', e)
                     return
                 else:
-                    import traceback
-                    traceback.print_exc()
+                    self._on_queue_thread_error(e, obj)
+
+    def _on_queue_thread_error(self, e, obj):
+        """
+        Private API called when feeding data in the background thread
+        raises an exception.  For overriding by concurrent.futures.
+        """
+        import traceback
+        traceback.print_exc()
+
History
Date User Action Args
2017-06-04 08:59:35tomMoralsetrecipients: + tomMoral, pitrou, davin, xiang.zhang, grzgrzgrz3
2017-06-04 08:59:34tomMoralsetmessageid: <1496566774.99.0.337618634577.issue30414@psf.upfronthosting.co.za>
2017-06-04 08:59:34tomMorallinkissue30414 messages
2017-06-04 08:59:34tomMoralcreate