Exception: Common::Exceptions::ServiceOutage
- Defined in:
- lib/common/exceptions/service_outage.rb
Overview
Service Outage - Breakers is reporting an outage on a backend system
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(outage = nil, options = {}) ⇒ ServiceOutage
constructor
A new instance of ServiceOutage.
Methods inherited from BaseError
#i18n_data, #i18n_field, #i18n_interpolated, #i18n_key, #log_to_sentry?, #message, #sentry_type, #status_code
Constructor Details
#initialize(outage = nil, options = {}) ⇒ ServiceOutage
Returns a new instance of ServiceOutage.
10 11 12 13 |
# File 'lib/common/exceptions/service_outage.rb', line 10 def initialize(outage = nil, = {}) @outage = outage @detail = [:detail] || i18n_field(:detail, service: @outage.service.name, since: @outage.start_time) end |
Instance Method Details
#errors ⇒ Object
15 16 17 |
# File 'lib/common/exceptions/service_outage.rb', line 15 def errors Array(SerializableError.new(i18n_data.merge(detail: @detail, status: 503))) end |