Exception: ActiveSanction::Sync::Failed
- Inherits:
-
StandardError
- Object
- StandardError
- ActiveSanction::Sync::Failed
- Extended by:
- T::Sig
- Includes:
- Error
- Defined in:
- lib/active_sanction/sync.rb
Overview
Raised by Report#success!, for a caller that wants any failure fatal. Never raised by the run itself: by the time a failure is known, every other source has already been fetched and stored.
The one error in the hierarchy that is about a run rather than about one list, which is why it hangs off Error directly and carries the whole report rather than a single #source_id.
Instance Attribute Summary collapse
- #report ⇒ Report readonly
Attributes included from Error
Instance Method Summary collapse
- #initialize(report) ⇒ void constructor
-
#retryable? ⇒ Boolean
True only when every source that failed failed retryably -- a run with one publisher timing out is worth re-running, and a run with a parse error in it is not going to come out differently in five minutes.
Methods included from Error
Constructor Details
#initialize(report) ⇒ void
115 116 117 118 |
# File 'lib/active_sanction/sync.rb', line 115 def initialize(report) @report = T.let(report, Report) super(report.) end |
Instance Attribute Details
#report ⇒ Report (readonly)
112 113 114 |
# File 'lib/active_sanction/sync.rb', line 112 def report @report end |
Instance Method Details
#retryable? ⇒ Boolean
True only when every source that failed failed retryably -- a run with one publisher timing out is worth re-running, and a run with a parse error in it is not going to come out differently in five minutes. A failure whose exception did not survive a round-trip through #to_h counts as not retryable, since nothing is known about it.
126 127 128 129 |
# File 'lib/active_sanction/sync.rb', line 126 def retryable? failures = report.failed.map(&:exception) retryable_or(failures.any? && failures.all? { |e| e.is_a?(ActiveSanction::Error) && e.retryable? }) end |