るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
4件ヒット [1-4件を表示] (0.067秒)

別のキーワード

  1. etc age
  2. cookie max_age
  3. passwd age
  4. etc age=
  5. passwd age=

クラス

キーワード

検索結果

Exception#message -> String (72631.0)

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

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

//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//}

Exception#to_s -> String (18031.0)

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

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

//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//}

Exception#exception(error_message) -> Exception (727.0)

引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。

引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー
を生成し Exception#message 属性を error_message にして返します。

Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。

@param error_message エラーメッセージを表す文字列を指定します。

//emlist[例][ruby]{
begin
# ... # 何か処理
rescue => e
raise e.exception("an error occurs during hogeho...

Thread#raise(error_type, message, traceback) -> () (631.0)

自身が表すスレッドで強制的に例外を発生させます。

自身が表すスレッドで強制的に例外を発生させます。

@param error_type Kernel.#raise を参照してください。

@param message Kernel.#raise を参照してください。

@param traceback Kernel.#raise を参照してください。

Thread.new {
sleep 1
Thread.main.raise "foobar"
}

begin
sleep
rescue
p $!, $@
end

=> #<RuntimeError: foobar>
[...