Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sugamasao/f29f330c273b5a5fadc64ebde60e5567 to your computer and use it in GitHub Desktop.
Save sugamasao/f29f330c273b5a5fadc64ebde60e5567 to your computer and use it in GitHub Desktop.
例外オブジェクト
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