X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=smart_future.py;h=2f3cbd9a9949f681e8a7cc70bd35ca43626e2861;hb=865825894beeedd47d26dd092d40bfee582f5475;hp=c96c5a712d9f8d829eb73a21082f2ffbc0f41d48;hpb=822454f580c1ff9eb207b8da46cdfae24e30cde1;p=python_utils.git 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