るりまサーチ

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

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. handler end_mapping

ライブラリ

クラス

キーワード

検索結果

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

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

...ception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。

現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。

//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if D...
...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...

Exception#backtrace -> [String] (3118.0)

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

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

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

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


begin
methd
rescue => e
p e.backtrace
end


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

@see Exception#backtrace_locations...

Ruby用語集 (64.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...Ruby用語集
A B C D E F G I J M N O R S Y

a ka sa ta na ha ma ya ra wa

=== 記号・数字
: %記法
: % notation
「%」記号で始まる多種多様なリテラル記法の総称。

参照:d:spec/literal#percent

: 0 オリジン
: zero-ba...
... Implementation)とも呼ばれる。

: Crystal
Ruby によく似たオブジェクト指向プログラミング言語。
型推論を持った静的型付け言語であり、処理系はコンパイラーである。

https://ja.crystal-lang.org/

: CSI 方式
CSI は Code Set Independ...
...ller_locations、Kernel.#caller で現時点までの
スタックトレースを得ることができる。

また、例外オブジェクトは例外が発生した時点までのスタックトレースを保持しており、
Exception#backtrace や Exception#backtrace_locations
...

NEWS for Ruby 3.0.0 (60.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting...
...tion warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end

//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesig...
...Encoding.default_external to UTF-8 on Windows 16604
* Fiber
* Fiber.new(blocking: true/false) allows you to create non-blocking execution contexts. 16786
* Fiber#blocking? tells whether the fiber is non-blocking. 16786
* Fiber#backtrace and Fiber#backtrace_locations provide per-fiber b...