diff --git a/lib/ferrum/utils/thread.rb b/lib/ferrum/utils/thread.rb index 6f4fa072..050a0db1 100644 --- a/lib/ferrum/utils/thread.rb +++ b/lib/ferrum/utils/thread.rb @@ -6,8 +6,8 @@ module Thread module_function def spawn(abort_on_exception: true) - ::Thread.new(abort_on_exception) do - ::Thread.current.abort_on_exception = abort_on_exception + ::Thread.new(abort_on_exception) do |whether_abort_on_exception| + ::Thread.current.abort_on_exception = whether_abort_on_exception ::Thread.current.report_on_exception = true if ::Thread.current.respond_to?(:report_on_exception=) yield