diff options
Diffstat (limited to 'smart_future.py')
| -rw-r--r-- | smart_future.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/smart_future.py b/smart_future.py index c96c5a7..2f3cbd9 100644 --- a/smart_future.py +++ b/smart_future.py @@ -40,8 +40,11 @@ def wait_any( if log_exceptions and not f.cancelled(): exception = f.exception() if exception is not None: + logger.warning( + f'Future {id(f)} raised an unhandled exception and exited.' + ) logger.exception(exception) - traceback.print_tb(exception.__traceback__) + raise exception yield smart_future_by_real_future[f] if callback is not None: callback() @@ -62,8 +65,11 @@ def wait_all( if not f.cancelled(): exception = f.exception() if exception is not None: + logger.warning( + f'Future {id(f)} raised an unhandled exception and exited.' + ) logger.exception(exception) - traceback.print_tb(exception.__traceback__) + raise exception assert len(done) == len(real_futures) assert len(not_done) == 0 |
