12件ヒット
[1-12件を表示]
(0.116秒)
ライブラリ
- ビルトイン (11)
-
minitest
/ unit (1)
クラス
- Exception (11)
-
MiniTest
:: Unit (1)
検索結果
先頭2件
-
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (36463.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if......aise "#{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
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'", "test.rb:15:i......n `<main>'"]
//}
@see Exception#backtrace... -
MiniTest
:: Unit # location(exception) -> String (24402.0) -
与えられた例外の発生した場所を返します。
与えられた例外の発生した場所を返します。