Ruby 1.8.7 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Exceptionクラス > message

instance method Exception#message

message -> String
to_s -> String
to_str -> String

エラーメッセージをあらわす文字列を返します。

begin
  1 + nil
rescue => e
  p e.message   #=>  "nil can't be coerced into Fixnum"
end
class Exception