るりまサーチ

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

別のキーワード

  1. _builtin raised_exception
  2. tracepoint raised_exception
  3. raised_exception _builtin
  4. raised_exception tracepoint

ライブラリ

検索結果

TracePoint#raised_exception -> Exception (24308.0)

発生した例外を返します。

...す。

@raise RuntimeError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。

//emlist[例][ruby]{
t
race = TracePoint.new(:raise) do |tp|
t
p.raised_exception # => #<ZeroDivisionError: divided by 0>
end
t
race.enable
begin...

TracePoint.new(*events) {|obj| ... } -> TracePoint (3113.0)

新しい TracePoint オブジェクトを作成して返します。トレースを有効 にするには TracePoint#enable を実行してください。

... TracePoint オブジェクトを作成して返します。トレースを有効
にするには TracePoint#enable を実行してください。

//emlist[例:irb で実行した場合][ruby]{
t
race = TracePoint.new(:call) do |tp|
p [tp.lineno, tp.defined_class, tp.method_id, tp.event]
end...
...=> #<TracePoint:0x007f17372cdb20>

t
race.enable
# => false

puts "Hello, TracePoint!"
# ...
# [69, IRB::Notifier::AbstractNotifier, :printf, :call]
# ...
//}

トレースを無効にするには TracePoint#disable を実行してください。

//emlist[][ruby]{
t
race.disable
//}

@param events...
...:thread_begin

スレッドの開始。

: :thread_end

スレッドの終了。



指定イベントに関連しない情報を取得するメソッドを実行した場合には
RuntimeError が発生します。

//emlist[例][ruby]{
TracePoint
.trace(:line) do |tp|
p tp.raised_exception...
...tch

ファイバーの切り替え。


指定イベントに関連しない情報を取得するメソッドを実行した場合には
RuntimeError が発生します。

//emlist[例][ruby]{
TracePoint
.trace(:line) do |tp|
p tp.raised_exception
end
# => RuntimeError: 'raised_exception' not...
...pt_compiled

スクリプトのコンパイル

指定イベントに関連しない情報を取得するメソッドを実行した場合には
RuntimeError が発生します。

//emlist[例][ruby]{
TracePoint
.trace(:line) do |tp|
p tp.raised_exception
end
# => RuntimeError: 'raised_excepti...