Exception: SafeImage::CommandError

Inherits:
Error
  • Object
show all
Defined in:
lib/safe_image/runner.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#original_error_class, #stderr_tail

Instance Method Summary collapse

Constructor Details

#initialize(message, command:, status: nil, stdout: "", stderr: "", category: :command, operation: nil, original_error_class: nil, stderr_tail: nil) ⇒ CommandError

Returns a new instance of CommandError.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/safe_image/runner.rb', line 11

def initialize(
  message,
  command:,
  status: nil,
  stdout: "",
  stderr: "",
  category: :command,
  operation: nil,
  original_error_class: nil,
  stderr_tail: nil
)
  super(message, original_error_class: original_error_class, stderr_tail: stderr_tail)
  @command = command
  @status = status
  @stdout = stdout
  @stderr = stderr
  @category = category&.to_sym
  @operation = operation&.to_sym
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



9
10
11
# File 'lib/safe_image/runner.rb', line 9

def category
  @category
end

#commandObject (readonly)

Returns the value of attribute command.



9
10
11
# File 'lib/safe_image/runner.rb', line 9

def command
  @command
end

#operationObject (readonly)

Returns the value of attribute operation.



9
10
11
# File 'lib/safe_image/runner.rb', line 9

def operation
  @operation
end

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/safe_image/runner.rb', line 9

def status
  @status
end

#stderrObject (readonly)

Returns the value of attribute stderr.



9
10
11
# File 'lib/safe_image/runner.rb', line 9

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



9
10
11
# File 'lib/safe_image/runner.rb', line 9

def stdout
  @stdout
end