Method: PryExceptionExplorer.init

Defined in:
lib/pry-exception_explorer.rb

.initObject

Set initial state



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/pry-exception_explorer.rb', line 225

def init
  # disable EE by default
  PryExceptionExplorer.enabled = false

  # auto-start sessions on exceptions that would kill the program
  PryExceptionExplorer.post_mortem = false

  # default is to capture all exceptions
  PryExceptionExplorer.intercept(Exception)

  # disable inline sessions by defulat
  PryExceptionExplorer.inline = false
  at_exit do
    ex = $!
    
    next if !PryExceptionExplorer.post_mortem? || !ex
    
    if ex.should_intercept?
      enter_exception(ex)
    else
      raise ex
    end
  end
end