Class: Rx::Middleware::Response::RxFailedStation
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- Rx::Middleware::Response::RxFailedStation
- Includes:
- SentryLogging
- Defined in:
- lib/rx/middleware/response/rx_failed_station.rb
Overview
Middleware class responsible for logging Rx Failed Station messages to Sentry
Instance Method Summary collapse
-
#on_complete(env) ⇒ Faraday::Env
Override the Faraday #on_complete method to log Rx failed station message to Sentry.
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata
Instance Method Details
#on_complete(env) ⇒ Faraday::Env
Override the Faraday #on_complete method to log Rx failed station message to Sentry
16 17 18 19 20 21 22 23 24 |
# File 'lib/rx/middleware/response/rx_failed_station.rb', line 16 def on_complete(env) return unless env.body.is_a? Hash station_list = env.body.try(:[], :metadata).try(:[], :failed_station_list) return if station_list.blank? = "Warning: prescription failed station list is not empty, '#{station_list}'" (, :warn) end |