File: C:/Ruby27-x64/share/ri/2.7.0/system/Thread/report_on_exception-c.ri
U:RDoc::AnyMethod[iI"report_on_exception:ETI" Thread::report_on_exception;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"HReturns the status of the global ``report on exception'' condition.;To:RDoc::Markup::BlankLine o;
; [I"*The default is +true+ since Ruby 2.5.;T@o;
; [I"<All threads created when this flag is true will report ;TI";a message on $stderr if an exception kills the thread.;T@o:RDoc::Markup::Verbatim; [I"&Thread.new { 1.times { raise } }
;T:@format0o;
; [I")will produce this output on $stderr:;T@o;; [ I"L#<Thread:...> terminated with exception (report_on_exception is true):
;TI"(Traceback (most recent call last):
;TI"/ 2: from -e:1:in `block in <main>'
;TI"% 1: from -e:1:in `times'
;T;
0o;
; [I"4This is done to catch errors in threads early. ;TI"4In some cases, you might not want this output. ;TI"7There are multiple ways to avoid the extra output:;T@o:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o;
; [I"GIf the exception is not intended, the best is to fix the cause of ;TI"1the exception so it does not happen anymore.;To;;0; [o;
; [I"MIf the exception is intended, it might be better to rescue it closer to ;TI";where it is raised rather then let it kill the Thread.;To;;0; [o;
; [I"GIf it is guaranteed the Thread will be joined with Thread#join or ;TI"?Thread#value, then it is safe to disable this report with ;TI"=<code>Thread.current.report_on_exception = false</code> ;TI"when starting the Thread. ;TI"HHowever, this might handle the exception much later, or not at all ;TI"Oif the Thread is never joined due to the parent thread being blocked, etc.;T@o;
; [I"%See also ::report_on_exception=.;T@o;
; [I"OThere is also an instance level method to set this for a specific thread, ;TI"see #report_on_exception=.;T:
@fileI"
thread.c;T:0@omit_headings_from_table_of_contents_below0I"3Thread.report_on_exception -> true or false
;T0[ I"();T@FFI"Thread;TcRDoc::NormalClass00