Skip to content

Instantly share code, notes, and snippets.

@david50407
Last active January 6, 2018 16:42
Show Gist options
  • Save david50407/4e01b29071c2fa6af2162e9d06f496de to your computer and use it in GitHub Desktop.
Save david50407/4e01b29071c2fa6af2162e9d06f496de to your computer and use it in GitHub Desktop.
class AE < StandardError
attr_reader :foo, :bar
def initialize(a, b= nil)
@foo= a
@bar= b
end
end
begin
raise AE, 'a', 'b'
rescue AE => e
[e.foo, e.bar, e.message] # ["a", nil, "AE"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment