Sha256: 9e5f26a5a1831ac5af8c7397e66fe1da13dd6f9fddca01b2c0656f6f66a80a5f

Contents?: true

Size: 342 Bytes

Versions: 7

Compression:

Stored size: 342 Bytes

Contents

require 'interception'
def log_exceptions(&block)
  Interception.listen(block) do |exception, binding|
    puts "raised: #{exception.inspect} from #{binding.eval("__method__")}"
  end
end

def hello
  raise "oopsy"
rescue => exception
  puts "rescued: #{exception.inspect} in #{__method__}"
  raise "daisy"
end

log_exceptions do
  hello
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
whos_dated_who-0.1.0 vendor/bundle/gems/interception-0.5/examples/example2.rb
whos_dated_who-0.0.1 vendor/bundle/gems/interception-0.5/examples/example2.rb
interception-0.5 examples/example2.rb
interception-0.4 examples/example2.rb
interception-0.3 examples/example2.rb
interception-0.2 examples/example2.rb
interception-0.1 examples/example2.rb