Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class · Ruby 4.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