Class: Cuprum::Cli::Errors::SystemCommandFailure

Inherits:
Error
  • Object
show all
Defined in:
lib/cuprum/cli/errors/system_command_failure.rb

Overview

Error returned when a system command returns a non-success status.

Constant Summary collapse

TYPE =

Short string used to identify the type of error.

'cuprum.cli.errors.system_command_failure'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command:, details: nil, exit_status: nil) ⇒ SystemCommandFailure

Returns a new instance of SystemCommandFailure.

Parameters:

  • command (String)

    the failed command.

  • details (String) (defaults to: nil)

    the error output from the process, if any.

  • exit_status (Integer) (defaults to: nil)

    the exit code returned by the process.



16
17
18
19
20
21
22
# File 'lib/cuprum/cli/errors/system_command_failure.rb', line 16

def initialize(command:, details: nil, exit_status: nil)
  @command     = command
  @details     = details
  @exit_status = exit_status

  super(message: default_message)
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



24
25
26
# File 'lib/cuprum/cli/errors/system_command_failure.rb', line 24

def command
  @command
end

#detailsObject (readonly)

Returns the value of attribute details.



26
27
28
# File 'lib/cuprum/cli/errors/system_command_failure.rb', line 26

def details
  @details
end

#exit_statusObject (readonly)

Returns the value of attribute exit_status.



28
29
30
# File 'lib/cuprum/cli/errors/system_command_failure.rb', line 28

def exit_status
  @exit_status
end