Method: PryExceptionExplorer.should_intercept_exception?

Defined in:
lib/pry-exception_explorer.rb

.should_intercept_exception?(frame, ex) ⇒ Boolean

This method invokes the PryExceptionExplorer.intercept_object, passing in the exception's frame and the exception object itself.

Parameters:

  • frame (Binding)

    The stack frame where the exception occurred.

  • ex (Exception)

    The exception that was raised.

Returns:

  • (Boolean)

    Whether the exception should be intercepted.



149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/pry-exception_explorer.rb', line 149

def should_intercept_exception?(frame, ex)
  # special case, or we go into infinite loop. CodeRay uses
  # exceptions for flow control :/
  if defined?(CodeRay::Encoders) && frame.eval('self') == CodeRay::Encoders
    false

    # normal case
  elsif intercept_object
    intercept_object.call(LazyFrame.new(frame), ex)
  else
    false
  end
end