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 ⇒ execution
readonly
The raw
{exit_code:, output:, argv:}execution result. -
#exit_error ⇒ ExitError?
readonly
A Yobi::ExitError parsed out of the output, if one is present.
Instance Method Summary collapse
-
#initialize(execution) ⇒ ResticExecutionError
constructor
:nodoc:.
Constructor Details
#initialize(execution) ⇒ ResticExecutionError
:nodoc:
63 64 65 66 67 |
# File 'lib/yobi/errors.rb', line 63 def initialize(execution) # :nodoc: @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 ⇒ execution (readonly)
The raw {exit_code:, output:, argv:} execution result.
59 60 61 |
# File 'lib/yobi/errors.rb', line 59 def execution @execution end |
#exit_error ⇒ ExitError? (readonly)
A Yobi::ExitError parsed out of the output, if one is present.
61 62 63 |
# File 'lib/yobi/errors.rb', line 61 def exit_error @exit_error end |