ConradIrwin / pry-rescue

Start a pry session whenever something goes wrong.
MIT License
850 stars 49 forks source link

Automatically prying uncaught Rails console errors? #64

Open suan opened 10 years ago

suan commented 10 years ago

I've tried many things but an unable to get pry-rescue to automatically pry when there's an uncaught exception in a Rails console. The README also only talks about using it in rails server. Is this just not supported?

kyrylo commented 10 years ago

https://github.com/charliesome/better_errors

banister commented 10 years ago

@kyrylo afaik better_errors does not intercept errors in the rails console

@suan, pry-rescue wont rescue it automatically, but you can enter rails console errors using cd-cause

suan commented 10 years ago

Thanks for the help. It turned out Pry::rescue { <expression> } was what I was looking for (though it's not automatic) Wonder if there's a way to wrap all irb/pry-rails expressions within a block...

banister commented 10 years ago

Override Pry.config.exception_handler to enter the exception