Quite a hack. Over in the Perl world, we just say "perl -MCarp::REPL your_app.pl" and we can have a REPL in the correct lexical context when an exception is thrown. Without adding methods to random classes. (And it all goes away when you run without -MCarp::REPL, of course.)