Exception: Circuitbox::ServiceFailureError

Inherits:
Error
  • Object
show all
Defined in:
lib/circuitbox/errors/service_failure_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service, exception) ⇒ ServiceFailureError

Returns a new instance of ServiceFailureError.



7
8
9
10
11
12
13
14
# File 'lib/circuitbox/errors/service_failure_error.rb', line 7

def initialize(service, exception)
  super()
  @service = service
  @original = exception
  # We copy over the original exceptions backtrace if there is one
  backtrace = exception.backtrace
  set_backtrace(backtrace) unless backtrace.empty?
end

Instance Attribute Details

#originalObject (readonly)

Returns the value of attribute original.



5
6
7
# File 'lib/circuitbox/errors/service_failure_error.rb', line 5

def original
  @original
end

#serviceObject (readonly)

Returns the value of attribute service.



5
6
7
# File 'lib/circuitbox/errors/service_failure_error.rb', line 5

def service
  @service
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/circuitbox/errors/service_failure_error.rb', line 16

def to_s
  "#{self.class}: Service #{service.inspect} was unavailable (original: #{original})"
end