Created
August 13, 2014 13:24
-
-
Save dentarg/d1a582e7c132b563ced5 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
irb(main):011:0> class ApiError < StandardError; end | |
=> nil | |
irb(main):012:0> begin | |
irb(main):013:1* raise ApiError, "lala" | |
irb(main):014:1> rescue StandardError => e | |
irb(main):015:1> puts e.name | |
irb(main):016:1> end | |
NoMethodError: undefined method `name' for #<ApiError: lala> | |
from (irb):15:in `rescue in irb_binding' | |
from (irb):12 | |
from /Users/dentarg/.rubies/ruby-2.1.2/bin/irb:11:in `<main>' | |
irb(main):017:0> ApiError | |
=> ApiError | |
irb(main):018:0> ApiError.name | |
=> "ApiError" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment