Hacker News new | ask | show | jobs
by cjbillington 2334 days ago
Yeah I considered extending it to automatically pop into the frame where the exception happened, but this is actually not as useful as it sounds, since the exception is usually much deeper in some other library and not in your code where you actually want to inspect variables. You would either need to declare the boundary between 'your' code and other code (by filepath or something), so the tool could know where it should run, or you would need to include commands to push and pop through the stack, which complicates things a bit and is on the path to a full debugger (so perhaps one should just use the debugger - as you've mentioned in the sibling comment).

So I just add a try: except around code known to be crashing and call my `embed()` function on except. This has served me well enough that I haven't bothered with anything else.

Plus, if I really want to inspect unplanned crashes, I would want to be able to get them when running, and not just developing, the app. So there might not even be a terminal - there are more complications than just 'not having to declare where you think it will crash', so I don't think I'll bother solving the more specific problem unless it would help me debug unexpected crashes in a broader context.