るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.044秒)
トップページ > クエリ:nil[x] > クエリ:set_backtrace[x]

別のキーワード

  1. stringio set_encoding
  2. set new
  3. _builtin set_encoding
  4. tracer set_get_line_procs
  5. set divide

ライブラリ

クラス

モジュール

検索結果

Exception#set_backtrace(errinfo) -> nil | String | [String] (18214.0)

バックトレース情報に errinfo を設定し、設定されたバックトレース 情報を返します。

...rinfo nil、String あるいは String の配列のいずれかを指定します。

//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
rescue
$!.backtrace # => ["/path/to/test.rb:5:in `rescue in <main>'", "/path/to/test.rb:2:in `<main>'"]
$!.set_backtrace(["d...

Kernel$$@ -> [String] | nil (119.0)

最後に例外が発生した時のバックトレースを表す配列です。 Kernel.#raise によって設定されます。

...す。

$@ へ値を代入するときは、$! が nil であってはいけません。
$@ の値は、$!.backtrace の値と同じです。
また、$@ への代入は $!.set_backtrace 呼び出しと同じです。

文字列の配列でも nil でもない値を代入しようとすると、 Typ...