catch-all

Catching all exceptions in Python

Catching all exceptions in Python Question: In Python, what’s the best way to catch “all” exceptions? except: # do stuff with sys.exc_info()[1] except BaseException as exc: except Exception as exc: The catch may be executing in a thread. My aim is to log any exception that might be thrown by normal code without masking any …

Total answers: 3