Exception: Yobi::Cancelled
- Defined in:
- lib/yobi/errors.rb,
sig/yobi.rbs
Overview
Raised when a run was stopped through a Yobi::Cancellation token.
Distinct from Yobi::ResticExecutionError and its subclasses: the run did not fail, the caller stopped it on purpose. Rescue this to record a cancellation without treating it as a backup failure.
Instance Attribute Summary collapse
-
#execution ⇒ cancelled_execution
readonly
The raw
{exit_code:, output:, argv:}result.
Instance Method Summary collapse
-
#argv ⇒ Array[String]
The argv of the run that was cancelled.
-
#before_start? ⇒ Boolean
True when the token was cancelled before Restic even started.
-
#initialize(execution) ⇒ Cancelled
constructor
:nodoc:.
Constructor Details
#initialize(execution) ⇒ Cancelled
:nodoc:
55 56 57 58 |
# File 'lib/yobi/errors.rb', line 55 def initialize(execution) # :nodoc: @execution = execution super("Restic run was cancelled") end |
Instance Attribute Details
#execution ⇒ cancelled_execution (readonly)
The raw {exit_code:, output:, argv:} result. exit_code: and
output: are nil when the token was already cancelled before
Restic was spawned at all.
53 54 55 |
# File 'lib/yobi/errors.rb', line 53 def execution @execution end |
Instance Method Details
#argv ⇒ Array[String]
The argv of the run that was cancelled.
61 62 63 |
# File 'lib/yobi/errors.rb', line 61 def argv execution[:argv] end |
#before_start? ⇒ Boolean
True when the token was cancelled before Restic even started.
66 67 68 |
# File 'lib/yobi/errors.rb', line 66 def before_start? execution[:exit_code].nil? end |