return host info if available in HostCommunicationError's addr_to_s
git-svn-id: file:///home/svn/framework3/trunk@6208 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
4e0bc60ce1
commit
2c039a87d2
|
@ -151,11 +151,17 @@ module HostCommunicationError
|
|||
end
|
||||
|
||||
#
|
||||
# This method returns a printable address and port associated with the host
|
||||
# that triggered the exception.
|
||||
# This method returns a printable address and optional port associated
|
||||
# with the host that triggered the exception.
|
||||
#
|
||||
def addr_to_s
|
||||
(host && port) ? "(#{host}:#{port})" : ""
|
||||
if host and port
|
||||
"(#{host}:#{port})"
|
||||
elsif host
|
||||
"(#{host})"
|
||||
else
|
||||
""
|
||||
end
|
||||
end
|
||||
|
||||
attr_accessor :host, :port
|
||||
|
|
Loading…
Reference in New Issue