Class: PrettyTimeouts::TimeoutError

Inherits:
Faraday::Error::TimeoutError
  • Object
show all
Defined in:
lib/pretty_timeouts/timeout_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service_name, timeout, url) ⇒ TimeoutError

Returns a new instance of TimeoutError.



5
6
7
8
9
# File 'lib/pretty_timeouts/timeout_error.rb', line 5

def initialize(service_name, timeout, url)
  @service_name = service_name
  @timeout = timeout
  @url = url
end

Instance Attribute Details

#service_nameObject (readonly)

Returns the value of attribute service_name.



3
4
5
# File 'lib/pretty_timeouts/timeout_error.rb', line 3

def service_name
  @service_name
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



3
4
5
# File 'lib/pretty_timeouts/timeout_error.rb', line 3

def timeout
  @timeout
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/pretty_timeouts/timeout_error.rb', line 3

def url
  @url
end

Instance Method Details

#messageObject



11
12
13
# File 'lib/pretty_timeouts/timeout_error.rb', line 11

def message
  "#{service_name} timeout of #{timeout}s reached attempting to connect to #{url}"
end