The code below starts a worker thread, in which an exception occurs after one successful step. Then the main thread first calls join, and then reads the result via value inside rescue.
stdout.Thread#join and Thread#value.Thread.report_on_exception = false, and Thread.abort_on_exception = false.Save the file as main.rb and run:
ruby main.rb
join should wait for the worker thread to finish.join.value, the exception from the worker thread should be re-raised in the main thread.3.3ruby interpreter, without Fiber schedulerThread is used, Thread.abort_on_exception = false, Thread.report_on_exception = falsejoin is usedClick a line and write what it prints. Explanation is optional.