るりまサーチ

最速Rubyリファレンスマニュアル検索!
45件ヒット [1-45件を表示] (0.325秒)
トップページ > クエリ:t[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 (24238.0)

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

...$stderr に報告します。

デフォルトはスレッド作成時の Thread.report_on_exception です。

@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。

//emlist[例][ruby]{
a = Thread.new{ Thr...
...ad.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thre...
...ad:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}

@see Thread.report_on_exception...

Thread.report_on_exception -> bool (24220.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) (12238.0)

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

...$stderr に報告します。

デフォルトはスレッド作成時の Thread.report_on_exception です。

@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。

//emlist[例][ruby]{
a = Thread.new{ Thr...
...ad.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thre...
...ad:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}

@see Thread.report_on_exception...

Thread.report_on_exception=(newstate) (12220.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...

NEWS for Ruby 2.4.0 (18.0)

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

...入ができるようになりました 10617
* Symbol#to_proc でメソッド呼び出し元での Refinements が有効になりました 9451
* Object#send や BasicObject#__send__ でメソッドを呼び出したときに Refinements が有効になりました 11476
* 後置 rescue を...
...ソッドの引数内に書けるようになりました 12686
* トップレベルで return を書けるようになりました 4840

=== 組み込みクラスの更新

* Array
* Array#concat 12333
複数の引数を取れるようになりました。
* Array#max, Array#min 1...
...atch は MatchData を返すようになりました 11991
* Symbol#match? を追加 12898
* Symbol#upcase, Symbol#downcase, Symbol#capitalize, Symbol#swapcase は
全ての Unicode に対して動作するようになりました。10085

* Thread
* Thread#report_on_exception, T...

絞り込み条件を変える