Skip to content

Commit a84e480

Browse files
committed
Hanlde EHOSTUNREACH error
1 parent c947b89 commit a84e480

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/net/ldap/connection.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def initialize(server)
1515
raise Net::LDAP::LdapError, "No such address or other socket error."
1616
rescue Errno::ECONNREFUSED
1717
raise Net::LDAP::LdapError, "Server #{server[:host]} refused connection on port #{server[:port]}."
18+
rescue Errno::EHOSTUNREACH => error
19+
raise Net::LDAP::LdapError, "Host #{server[:host]} was unreachable (#{error.message})"
1820
end
1921

2022
if server[:encryption]

0 commit comments

Comments
 (0)