diff options
| -rw-r--r-- | lib/custodian/protocoltest/ldap.rb | 29 | 
1 files changed, 14 insertions, 15 deletions
| diff --git a/lib/custodian/protocoltest/ldap.rb b/lib/custodian/protocoltest/ldap.rb index baabd7f..4509ee0 100644 --- a/lib/custodian/protocoltest/ldap.rb +++ b/lib/custodian/protocoltest/ldap.rb @@ -126,27 +126,26 @@ module Custodian              @error = "failed to bind to LDAP server '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'"              return false            end +        rescue LDAP::ResultError => ex +          @error = "LDAP exception: #{ex} when talking to LDAP server '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" +          return false          end -      rescue LDAP::ResultError => ex -        @error = "LDAP exception: #{ex} when talking to LDAP server '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" -        return false -      end - -      @error = "LDAP server test failed against '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" -      false -    end +        @error = "LDAP server test failed against '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" +        false +      end -    # -    # If the test fails then report the error. -    # -    def error -      @error -    end +      # +      # If the test fails then report the error. +      # +      def error +        @error +      end -    register_test_type 'ldap' +      register_test_type 'ldap' +    end    end  end | 
