Class: Connectors::TolerableErrorHelper
- Inherits:
-
Object
- Object
- Connectors::TolerableErrorHelper
- Defined in:
- lib/connectors/tolerable_error_helper.rb
Instance Method Summary collapse
-
#initialize(error_monitor) ⇒ TolerableErrorHelper
constructor
A new instance of TolerableErrorHelper.
- #yield_single_document(identifier: nil) ⇒ Object
Constructor Details
#initialize(error_monitor) ⇒ TolerableErrorHelper
Returns a new instance of TolerableErrorHelper.
13 14 15 |
# File 'lib/connectors/tolerable_error_helper.rb', line 13 def initialize(error_monitor) @error_monitor = error_monitor end |
Instance Method Details
#yield_single_document(identifier: nil) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/connectors/tolerable_error_helper.rb', line 17 def yield_single_document(identifier: nil) Utility::Logger.debug("Extracting single document for #{identifier}") if identifier yield @error_monitor.note_success rescue *fatal_exception_classes => e Utility::ExceptionTracking.augment_exception(e) Utility::Logger.error("Encountered a fall-through error during extraction#{(identifier)}: #{e.class}: #{e.} {:message_id => #{e.id}}") raise rescue StandardError => e Utility::ExceptionTracking.augment_exception(e) Utility::Logger.warn("Encountered error during extraction#{(identifier)}: #{e.class}: #{e.} {:message_id => #{e.id}}") @error_monitor.note_error(e, :id => e.id) end |