KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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 special Python exceptions, such as those that indicate process termination etc. Getting a handle to the exception (such as by the clauses above that contain exc ) is also desirable.
Tags (comma-separated)
Save Edits
Cancel