Skip to content

Instantly share code, notes, and snippets.

@havenwood
Last active December 10, 2019 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save havenwood/1f4e9d36926e33d00875300b6aeba50e to your computer and use it in GitHub Desktop.
Save havenwood/1f4e9d36926e33d00875300b6aeba50e to your computer and use it in GitHub Desktop.
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