Exception: Chutzen::Command::ExecutionFailed

Inherits:
StandardError
  • Object
show all
Defined in:
lib/chutzen/command/execution_failed.rb

Overview

Raised when execution of a command fails.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, command: nil) ⇒ ExecutionFailed

Returns a new instance of ExecutionFailed.



10
11
12
13
# File 'lib/chutzen/command/execution_failed.rb', line 10

def initialize(message, command: nil)
  super(message)
  @command = command
end

Instance Attribute Details

#commandObject (readonly)

Instance of Command that triggered the error.



8
9
10
# File 'lib/chutzen/command/execution_failed.rb', line 8

def command
  @command
end

Instance Method Details

#as_jsonObject



15
16
17
# File 'lib/chutzen/command/execution_failed.rb', line 15

def as_json
  { 'error' => details }
end