In rails you can just do:
class ApplicationController < ActionController::Base
around_filter :pry_rescue if Rails.env == 'development'
def pry_rescue
Pry::rescue{ yield }
end
I'm hoping to get a Rack middleware out at some point; which will make this even easier.