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:

  • execution (Hash)


74
75
76
77
78
# File 'lib/yobi/errors.rb', line 74

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



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

def execution
  @execution
end

#exit_errorYobi::ExitError? (readonly)

Returns:



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

def exit_error
  @exit_error
end