-
-
Save havenwood/1f4e9d36926e33d00875300b6aeba50e 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
class FooError < StandardError | |
attr_reader :data | |
def initialize(message = 'Beep, bop, boop!', data: {}) | |
@data = data | |
super(message) | |
end | |
end | |
begin | |
raise FooError, data: {aim: true} | |
rescue FooError => e | |
p e.data | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment