Exception: Tina4Ultipa::ConnectError

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

Overview

Could not connect within the timeout. Names host, port and elapsed seconds.

Instance Attribute Summary collapse

Attributes inherited from Error

#cause_error, #code

Instance Method Summary collapse

Constructor Details

#initialize(host, port, elapsed, cause: nil) ⇒ ConnectError

Returns a new instance of ConnectError.



24
25
26
27
28
29
30
31
32
33
# File 'lib/tina4_ultipa/errors.rb', line 24

def initialize(host, port, elapsed, cause: nil)
  super(
    "could not connect to ultipa at #{host}:#{port} within #{format('%.2f', elapsed)}s",
    code: "UNAVAILABLE",
    cause: cause,
  )
  @host = host
  @port = port
  @elapsed = elapsed
end

Instance Attribute Details

#elapsedObject (readonly)

Returns the value of attribute elapsed.



22
23
24
# File 'lib/tina4_ultipa/errors.rb', line 22

def elapsed
  @elapsed
end

#hostObject (readonly)

Returns the value of attribute host.



22
23
24
# File 'lib/tina4_ultipa/errors.rb', line 22

def host
  @host
end

#portObject (readonly)

Returns the value of attribute port.



22
23
24
# File 'lib/tina4_ultipa/errors.rb', line 22

def port
  @port
end