Exception: Exception

Defined in:
lib/pry-exception_explorer/core_ext.rb

Overview

PryExceptionExplorer monkey-patches to Exception

Constant Summary

NoContinuation =
Class.new(StandardError)

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Continuation) continuation

Returns The continuation object for the exception. Invoking this continuation will allow the program to continue from the point the exception was raised.

Returns:

  • (Continuation)

    The continuation object for the exception. Invoking this continuation will allow the program to continue from the point the exception was raised.



8
9
10
# File 'lib/pry-exception_explorer/core_ext.rb', line 8

def continuation
  @continuation
end

- (Array<Binding>) exception_call_stack

Returns The array of bindings that represent the call stack for the exception. This is navigable inside the Pry session with the up and down and frame commands.

Returns:

  • (Array<Binding>)

    The array of bindings that represent the call stack for the exception. This is navigable inside the Pry session with the up and down and frame commands.



13
14
15
# File 'lib/pry-exception_explorer/core_ext.rb', line 13

def exception_call_stack
  @exception_call_stack
end

- (Boolean) should_intercept Also known as: should_intercept?

Returns Whether this exception should be intercepted. (Only relevant for wrapped exceptions).

Returns:

  • (Boolean)

    Whether this exception should be intercepted. (Only relevant for wrapped exceptions).



17
18
19
# File 'lib/pry-exception_explorer/core_ext.rb', line 17

def should_intercept
  @should_intercept
end

Instance Method Details

- (Object) continue

This method enables us to continue an exception (using callcc internally)

Raises:



21
22
23
24
# File 'lib/pry-exception_explorer/core_ext.rb', line 21

def continue
  raise NoContinuation unless continuation.respond_to?(:call)
  continuation.call
end