Thanks for this. How would I use it in Rails? Any tips for integration?
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. pry_rescue.rb
require 'pry/rescue'
class PryRescue
def initialize(app)
@app = app
end
def call(env)
Pry::rescue{ @app.call(env) }
end
end
For rails you need to require the file and use the middleware... application.rb
config.middleware.use "PryRescue"