Exception: Cartage::StatusError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cartage.rb

Overview

Plug-in commands that want to return a specific exit code should use Cartage::StatusError to wrap the error.

Direct Known Subclasses

QuietError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exitstatus, exception_or_message) ⇒ StatusError

Initialize the exception with exitstatus and the exception to wrap.



11
12
13
14
# File 'lib/cartage.rb', line 11

def initialize(exitstatus, exception_or_message)
  super(exception_or_message) if exception_or_message
  @exitstatus = exitstatus
end

Instance Attribute Details

#exitstatusObject (readonly)

The exit status to be returned from this exception.



17
18
19
# File 'lib/cartage.rb', line 17

def exitstatus
  @exitstatus
end