module Thread

Hack makes sure exceptions in Threads like the one in looper.rb that reports to CloudWatch gets reported instead of silently being swallowed. bugs.ruby-lang.org/issues/6647

Public Class Methods

new(*args, &block) click to toggle source
# File lib/puma_cloudwatch/core_ext/thread.rb, line 7
def new(*args, &block)
  old_new(*args) do |*bargs|
    begin
      block.call(*bargs)
    rescue Exception => e
      raise if Thread.abort_on_exception || Thread.current.abort_on_exception
      puts "Thread for block #{block.inspect} terminated with exception: #{e.message}"
      puts e.backtrace.reverse.map {|line| "  #{line}"}
    end
  end
end
Also aliased as: old_new
old_new(*args, &block)
Alias for: new