るりまサーチ

最速Rubyリファレンスマニュアル検索!
50件ヒット [1-50件を表示] (0.320秒)
トップページ > クエリ:_builtin[x] > ライブラリ:ビルトイン[x] > クエリ:UncaughtThrowError[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

クラス

モジュール

キーワード

検索結果

UncaughtThrowError (46008.0)

Kernel.#throw に指定した tag に対して一致する Kernel.#catch が存在しない場合に発生します。

...Kernel.#throw に指定した tag に対して一致する
Kernel.#catch が存在しない場合に発生します。

throw "foo", "bar"
# => (例外発生) UncaughtThrowError: uncaught throw "foo"...

UncaughtThrowError#tag -> object (29008.0)

Kernel.#throw に指定した tag を返します。

...Kernel.#throw に指定した tag を返します。

//emlist[例:][ruby]{
def do_complicated_things
throw :uncaught_label
end

begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.tag # => ":uncaught_label"
end
//}...

UncaughtThrowError#to_s -> String (29008.0)

self を tag を含む文字列表現にして返します。

...self を tag を含む文字列表現にして返します。

//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label
end

begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.to_s # => "uncaught throw :uncaught_label"
end
//}...

UncaughtThrowError#value -> object (29008.0)

Kernel.#throw に指定した value を返します。

...Kernel.#throw に指定した value を返します。

//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label, "uncaught_value"
end

begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.value # => "uncaught_value"
end
//}...

Kernel.#throw(tag, value = nil) -> () (8008.0)

Kernel.#catchとの組み合わせで大域脱出を行います。 throw は同じ tag を指定した catch のブロックの終わりまでジャンプします。

...

@param tag catch の引数に対応する任意のオブジェクトです。
@param value catch の戻り値になります。
@raise UncaughtThrowError 同じ tag で待っている catch が存在しない場合に発生します。

//emlist[例][ruby]{
def foo
throw :exit, 25
end

ret =...

絞り込み条件を変える