re-raise async exceptions in main thread
This commit is contained in:
@@ -55,6 +55,8 @@ class AsynchronousExtractor(Extractor):
|
|||||||
task = get()
|
task = get()
|
||||||
if task is None:
|
if task is None:
|
||||||
return
|
return
|
||||||
|
if isinstance(task, Exception):
|
||||||
|
raise task
|
||||||
yield task
|
yield task
|
||||||
done()
|
done()
|
||||||
|
|
||||||
@@ -63,9 +65,8 @@ class AsynchronousExtractor(Extractor):
|
|||||||
try:
|
try:
|
||||||
for task in self.items():
|
for task in self.items():
|
||||||
put(task)
|
put(task)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
import traceback
|
put(e)
|
||||||
print(traceback.format_exc())
|
|
||||||
put(None)
|
put(None)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user