Exception: Everywhere::Fatal

Inherits:
SystemExit
  • Object
show all
Defined in:
lib/everywhere/fatal.rb

Overview

A failure that ends the current unit of work — not necessarily the process.

It subclasses SystemExit deliberately. At the top level Ruby exits with #status and prints nothing (UI.die! has already written the ✗ line), so an uncaught Fatal behaves exactly like the Kernel#abort it replaces. Inside every dev a worker thread catches it instead and returns to the key menu, which is the whole point: a Swift typo must not take the Rails server down with it.

CAUTION for anyone catching this in a thread: MRI enqueues a SystemExit that escapes a non-main thread onto the MAIN thread, which re-raises it wherever that thread happens to be. A worker must therefore rescue Exception, not rescue Everywhere::Fatal — see TaskPool.

Instance Method Summary collapse

Constructor Details

#initialize(status = 1, message = nil) ⇒ Fatal

Returns a new instance of Fatal.



18
# File 'lib/everywhere/fatal.rb', line 18

def initialize(status = 1, message = nil) = super