Exception: Yobi::ResticExecutionError

Inherits:
Error
  • Object
show all
Defined in:
lib/yobi/errors.rb,
sig/yobi.rbs

Overview

Raised when Restic exits with a failure code. Base class for the specific typed errors below.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(execution) ⇒ ResticExecutionError

Returns a new instance of ResticExecutionError.

Parameters:



71
72
73
74
75
# File 'lib/yobi/errors.rb', line 71

def initialize(execution)
  @execution = execution
  @exit_error = Yobi::ExitError.from_output(execution[:output])
  super(exit_error&.message || "Restic exited with status #{execution[:exit_code]}: #{execution[:output]}")
end

Instance Attribute Details

#executionHash (readonly)

Returns the raw {exit_code:, output:, argv:} execution result.

Returns:

  • (Hash)

    the raw {exit_code:, output:, argv:} execution result



66
67
68
# File 'lib/yobi/errors.rb', line 66

def execution
  @execution
end

#exit_errorYobi::ExitError? (readonly)

Returns:



68
69
70
# File 'lib/yobi/errors.rb', line 68

def exit_error
  @exit_error
end