Class: Cocina::Models::Mapping::ErrorNotifier
- Inherits:
-
Object
- Object
- Cocina::Models::Mapping::ErrorNotifier
- Defined in:
- lib/cocina/models/mapping/error_notifier.rb
Overview
Notifies when a data error is encountered. Notification is performed with Honeybadger.
Instance Method Summary collapse
-
#error(message, _context = {}) ⇒ Object
Notify for a critical data error.
-
#initialize(druid:) ⇒ ErrorNotifier
constructor
A new instance of ErrorNotifier.
-
#warn(message, _context = {}) ⇒ Object
Notify for a non-critical data error.
Constructor Details
#initialize(druid:) ⇒ ErrorNotifier
Returns a new instance of ErrorNotifier.
12 13 14 |
# File 'lib/cocina/models/mapping/error_notifier.rb', line 12 def initialize(druid:) @druid = druid end |
Instance Method Details
#error(message, _context = {}) ⇒ Object
Notify for a critical data error.
26 27 28 |
# File 'lib/cocina/models/mapping/error_notifier.rb', line 26 def error(, _context = {}) Kernel.warn "[ERROR] #{}" end |
#warn(message, _context = {}) ⇒ Object
Notify for a non-critical data error.
19 20 21 |
# File 'lib/cocina/models/mapping/error_notifier.rb', line 19 def warn(, _context = {}) Kernel.warn "[WARN] #{}" end |