Method: PryExceptionExplorer.setup_exception_context

Defined in:
lib/pry-exception_explorer.rb

.setup_exception_context(ex, _pry_, options = {}) ⇒ Object

Prepare the Pry instance and associated call-stack when entering into an exception context.

Parameters:

  • ex (Exception)

    The exception.

  • _pry_ (Pry)

    The relevant Pry instance.

  • options (Hash) (defaults to: {})

    The optional configuration parameters.

Options Hash (options):

  • :inline (Boolean)

    Whether the exception is being entered inline (i.e within the raise method itself)



195
196
197
198
199
200
201
# File 'lib/pry-exception_explorer.rb', line 195

def setup_exception_context(ex, _pry_, options={})
  _pry_.last_exception = ex 
  _pry_.backtrace = (ex.backtrace || [])

  PryStackExplorer.frame_manager(_pry_).user[:exception]        = ex
  PryStackExplorer.frame_manager(_pry_).user[:inline_exception] = !!options[:inline]
end