Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 315 Bytes

bubbling-up-thread-errors.md

File metadata and controls

20 lines (13 loc) · 315 Bytes

Bubbling up thread errors

Thread.abort_on_exception = true

Thread.new do
  fail 'Ops, we cannot continue'
end

loop do
  sleep
end

# Result:
# ./bubbling_up_thread_errors.rb:4:in `block in <main>': Ops, we cannot continue (RuntimeError)

View Source