9

I'm trying to use pry-rescue inside of a rake task. Something like this:

   bundle exec rescue rake my:task

But when an exception occurs (undefined method...) it just exists like normal. How can I use pry-rescue with my rake task?

Gil Birman
  • 35,242
  • 14
  • 75
  • 119

1 Answers1

6

Did you try wrapping your task body in a rescue block?

task 'my_task' do
  Pry.rescue {
    things.that_need_doing
  }
end
prater
  • 2,330
  • 1
  • 17
  • 15