Skip to content

Instantly share code, notes, and snippets.

@jhirn
Created September 12, 2013 18:13
Show Gist options
  • Save jhirn/6541655 to your computer and use it in GitHub Desktop.
Save jhirn/6541655 to your computer and use it in GitHub Desktop.
def raise_error
raise RuntimeError
end
class Foo
def method_missing(name, *args)
raise_error
end
end
class RescueBlock
def method_missing(name, *args)
begin
raise_error
rescue
puts :safe
end
end
end
class RescueBlockToo < BasicObject
def method_missing(name, *args)
begin
raise_error
rescue
puts :not_safe
end
end
end
class Inline
def method_missing(name, *args)
raise_error rescue :safe
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment