Created
August 31, 2018 19:06
-
-
Save repomaa/a9f16d5f7a902e5ffca6f49b7d0027a4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class AError < Exception | |
getter foo | |
def initialize(@foo : String, message) | |
super(message) | |
end | |
end | |
class BError < Exception | |
getter foo | |
def initialize(@foo : String, message) | |
super(message) | |
end | |
end | |
class CError < Exception | |
getter foo | |
def initialize(@foo : String, message) | |
super(message) | |
end | |
end | |
alias MyError = AError | BError | CError | |
begin | |
puts "hi" | |
rescue ex : MyError | |
puts(ex.foo) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment