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

:nodoc:



90
91
92
93
94
# File 'lib/yobi/errors.rb', line 90

def initialize(execution) # :nodoc:
  @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

#executionexecution (readonly)

The raw {exit_code:, output:, argv:} execution result.



86
87
88
# File 'lib/yobi/errors.rb', line 86

def execution
  @execution
end

#exit_errorExitError? (readonly)

A Yobi::ExitError parsed out of the output, if one is present.



88
89
90
# File 'lib/yobi/errors.rb', line 88

def exit_error
  @exit_error
end