Class: Pry
- Inherits:
-
Object
- Object
- Pry
- Defined in:
- lib/pry-capture/core_ext.rb
Class Method Summary collapse
-
.capture(&block) ⇒ Object
Start a pry session on any unhandled exceptions within this block.
Class Method Details
.capture(&block) ⇒ Object
Start a pry session on any unhandled exceptions within this block.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pry-capture/core_ext.rb', line 11 def self.capture(&block) raised = [] Interception.listen(block) do |exception, binding| if defined?(PryStackExplorer) raised << [exception, binding.callers] else raised << [exception, Array(binding)] end end rescue Exception => e PryCapture.enter_exception_context(raised) raise end |