method

raise

v1_8_6_287 - Show latest stable - Class: Thread
raise(...)
public

Raises an exception (see Kernel::raise) from thr. The caller does not have to be thr.

   Thread.abort_on_exception = true
   a = Thread.new { sleep(200) }
   a.raise("Gotcha")

produces:

   prog.rb:3: Gotcha (RuntimeError)
    from prog.rb:2:in `initialize'
    from prog.rb:2:in `new'
    from prog.rb:2