Exception: Yobi::ResticExecutionError
- 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.
Direct Known Subclasses
AuthenticationFailed, RepositoryLocked, RepositoryNotFound, ResticCommandFailed
Instance Attribute Summary collapse
-
#execution ⇒ Hash
readonly
The raw
{exit_code:, output:, argv:}execution result. - #exit_error ⇒ Yobi::ExitError? readonly
Instance Method Summary collapse
-
#initialize(execution) ⇒ ResticExecutionError
constructor
A new instance of ResticExecutionError.
Constructor Details
#initialize(execution) ⇒ ResticExecutionError
Returns a new instance of ResticExecutionError.
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&. || "Restic exited with status #{execution[:exit_code]}: #{execution[:output]}") end |
Instance Attribute Details
#execution ⇒ Hash (readonly)
Returns the raw {exit_code:, output:, argv:} execution result.
69 70 71 |
# File 'lib/yobi/errors.rb', line 69 def execution @execution end |
#exit_error ⇒ Yobi::ExitError? (readonly)
71 72 73 |
# File 'lib/yobi/errors.rb', line 71 def exit_error @exit_error end |