-
-
Save anildigital/a184b92b2e9624e0b2fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Less | |
class Error < ::StandardError | |
def initialize(msg) | |
puts "<<<<" + msg + ">>>>" | |
super(msg) | |
end | |
end | |
class StandardError < Exception | |
def initialize(msg) | |
puts "BAD BAD BAD" | |
super(msg) | |
end | |
end | |
end | |
class Awesome | |
include Less | |
def something | |
raise Error, "This is bad bad bad" | |
end | |
end | |
a = Awesome.new | |
a.something |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<<<<This is bad bad bad>>>> | |
/Users/anil.wadghule/Code/ruby/exception_hierarchy_test.rb:26:in `something': This is bad bad bad (Less::Error) | |
from /Users/anil.wadghule/Code/ruby/exception_hierarchy_test.rb:34:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment