diff --git a/lib/net/ldap/connection.rb b/lib/net/ldap/connection.rb index 91fb7e90..508e37ac 100644 --- a/lib/net/ldap/connection.rb +++ b/lib/net/ldap/connection.rb @@ -17,6 +17,8 @@ def initialize(server) raise Net::LDAP::LdapError, "Server #{server[:host]} refused connection on port #{server[:port]}." rescue Errno::EHOSTUNREACH => error raise Net::LDAP::LdapError, "Host #{server[:host]} was unreachable (#{error.message})" + rescue Errno::ETIMEDOUT + raise Net::LDAP::LdapError, "Connection to #{server[:host]} timed out." end if server[:encryption]