Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class · Ruby 3.1

ThreadError

Raised when an invalid operation is attempted on a thread.

For example, when no other thread has been started:

Example
Thread.stop

This will raises the following exception:

ThreadError: stopping only thread
note: use sleep to stop forever