#2353·pry

Cannot access $! variable in the case of uncaught exception

Author: IsptMartinCreated Jul 23, 2025Updated Jul 23, 2025

Sometimes I want to inspect the exception raised by a method that I call in the console. However the $! variable is not set like irb does it.

This makes investigating exception root cause harder.

I would be great if that variable was set as in irb.