Created
June 2, 2017 13:12
-
-
Save sugamasao/f29f330c273b5a5fadc64ebde60e5567 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):001:0> begin | |
irb(main):002:1* raise ArgumentError, '何かエラー' | |
irb(main):003:1> rescue => e | |
irb(main):004:1> puts "e.class = #{ e.class }" | |
irb(main):005:1> puts "e.message = #{ e.message }" | |
irb(main):006:1> end | |
e.class = ArgumentError | |
e.message = 何かエラー | |
=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment