Currently, all Exceptions are caught and few, if any, are reraised. This prohibits any fatal exceptions from forcing a system exit. Essentially, we want to catch and reraise fatal errors (SystemExits) independently from generic Exceptions like this:
From:
try:
...
except Exception as e:
print(...)
pass
To:
try:
...
except SystemExit as e:
raise SystemExit('FATAL ERROR ...') from e
except Exception as e:
print(...)
pass
Currently, all Exceptions are caught and few, if any, are reraised. This prohibits any fatal exceptions from forcing a system exit. Essentially, we want to catch and reraise fatal errors (
SystemExit
s) independently from genericException
s like this:From:
To:
See equivalent issue in my fork: https://github.com/zhanwenchen/AgentBoard/issues/1