るりまサーチ

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

別のキーワード

  1. string []=
  2. string slice!
  3. string []
  4. string slice
  5. string gsub!

ライブラリ

検索結果

Exception#backtrace -> [String] (114.0)

バックトレース情報を返します。

...を返します。

デフォルトでは

* "#{sourcefile}:#{sourceline}:in `#{method}'"
(メソッド内の場合)
* "#{sourcefile}:#{sourceline}"
(トップレベルの場合)

という形式の String の配列です。

//emlist[例][ruby]{
def methd
raise
end

begin
methd
resc...
...ue => e
p e.backtrace
end

#=> ["filename.rb:2:in `methd'", "filename.rb:6"]
//}

@see Exception#backtrace_locations...