Is it possible to automatically break into the debugger when a exception is thrown?

You don’t want to break on every exception; idiomatic Python code uses exceptions heavily (EAFP) so you’d be continually breaking in unrelated code.

Instead, use pdb post-mortem: import pdb; pdb.pm(). This uses sys.last_traceback to inspect the stack including the locals at the throw point.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)