るりまサーチ

最速Rubyリファレンスマニュアル検索!
18件ヒット [1-18件を表示] (0.361秒)
トップページ > クエリ:t[x] > 種類:特異メソッド[x] > クエリ:report_on_exception[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

検索結果

Thread.report_on_exception -> bool (24221.0)

真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

...、その内容を $stderr に報告します。

デフォルトは false です。

T
hread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):
T
raceback (most recent call last):
2: from...
...-e:1:in `block in <main>'
1: from -e:1:in `times'

これによってスレッドのエラーを早期に捕捉できるようになります。
いくつかのケースでは、この出力を望まないかもしれません。
出力を抑制するには複数の方法があります:...
...終了しないようにするのがより良い方法です。
* Thread#join や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレポートを無効化しても
安全です。し...
...、その内容を $stderr に報告します。

デフォルトは true です。

T
hread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):
T
raceback (most recent call last):
2: from...

Thread.report_on_exception=(newstate) (12221.0)

真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

...、その内容を $stderr に報告します。

デフォルトは false です。

T
hread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):
T
raceback (most recent call last):
2: from...
...-e:1:in `block in <main>'
1: from -e:1:in `times'

これによってスレッドのエラーを早期に捕捉できるようになります。
いくつかのケースでは、この出力を望まないかもしれません。
出力を抑制するには複数の方法があります:...
...終了しないようにするのがより良い方法です。
* Thread#join や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレポートを無効化しても
安全です。し...
...、その内容を $stderr に報告します。

デフォルトは true です。

T
hread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):
T
raceback (most recent call last):
2: from...