Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's a basic middleware...

  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"


I know this is short and simple, but it still might be nice to wrap up in a gem. Or maybe work into the pry-rails gem?




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: