From f0f7306db6393bca39e5a3e435b9aa230f769796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 24 Jul 2016 22:16:59 +0200 Subject: [PATCH] re-raise async exceptions in main thread --- gallery_dl/extractor/common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 11d48eee..23619147 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -55,6 +55,8 @@ class AsynchronousExtractor(Extractor): task = get() if task is None: return + if isinstance(task, Exception): + raise task yield task done() @@ -63,9 +65,8 @@ class AsynchronousExtractor(Extractor): try: for task in self.items(): put(task) - except Exception: - import traceback - print(traceback.format_exc()) + except Exception as e: + put(e) put(None)