Class: SpreeDoordash::Alerting
- Inherits:
-
Object
- Object
- SpreeDoordash::Alerting
- Defined in:
- app/services/spree_doordash/alerting.rb
Overview
One place for "this needs a human" — used when a job exhausts its retries. A standalone copy of SpreeSquare::Alerting's pattern rather than a dependency on that gem — spree_doordash stays independently installable on its own. Reports to Sentry when available, always logs at error level regardless so nothing depends on Sentry being configured to at least be visible in the server log.
Class Method Summary collapse
Class Method Details
.capture(error, context: {}) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/services/spree_doordash/alerting.rb', line 9 def self.capture(error, context: {}) context = { source: 'spree_doordash' }.merge(context.is_a?(String) ? { area: context } : context) Rails.logger.error("[SpreeDoordash] #{context[:area] || 'error'}: #{error.class}: #{error.}") return unless defined?(Sentry) Sentry.capture_exception(error, extra: context) end |