Exception: Breakers::OutageException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/breakers/outage_exception.rb

Overview

The error that is raised when a request is made against a service that is experiencing an outage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(outage, service) ⇒ OutageException

Returns a new instance of OutageException.



8
9
10
11
# File 'lib/breakers/outage_exception.rb', line 8

def initialize(outage, service)
  @outage = outage
  @service = service
end

Instance Attribute Details

#outageObject (readonly)

Returns the value of attribute outage.



5
6
7
# File 'lib/breakers/outage_exception.rb', line 5

def outage
  @outage
end

#serviceObject (readonly)

Returns the value of attribute service.



6
7
8
# File 'lib/breakers/outage_exception.rb', line 6

def service
  @service
end

Instance Method Details

#messageObject



13
14
15
# File 'lib/breakers/outage_exception.rb', line 13

def message
  "Outage detected on #{@service.name} beginning at #{@outage.start_time.to_i}"
end