るりまサーチ

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

別のキーワード

  1. _builtin yield
  2. object yield_self
  3. _builtin yield_self
  4. yielder yield
  5. proc yield

ライブラリ

クラス

検索結果

Exception#backtrace_locations -> [Thread::Backtrace::Location] (18120.0)

バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。

...: test.rb][ruby]{
require "date"
def check_long_month(month)
return if Date.new(2000, month, -1).day == 31
raise "#{month} is not long month"
end

def get_exception
return begin
yield

rescue => e
e
end
end

e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["te...