Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Koller <markus-koller@gmx.ch>2016-08-30 14:21:33 +0300
committerRémy Coutable <remy@rymai.me>2016-09-28 08:44:58 +0300
commit68364fe2f03a543c4ad89553f50b6fa30d143331 (patch)
tree353d0d580a8ece951f0ba73c0015fb1416bff2e5 /lib/gitlab/ldap
parent3b206ccb8393d8f2c5ad227874d9a60beb054782 (diff)
Log LDAP lookup errors and don't swallow unrelated exceptions
Signed-off-by: Roger Meier <r.meier@siemens.com>
Diffstat (limited to 'lib/gitlab/ldap')
-rw-r--r--lib/gitlab/ldap/access.rb2
-rw-r--r--lib/gitlab/ldap/adapter.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/ldap/access.rb b/lib/gitlab/ldap/access.rb
index 2f326d00a2f..7e06bd2b0fb 100644
--- a/lib/gitlab/ldap/access.rb
+++ b/lib/gitlab/ldap/access.rb
@@ -51,8 +51,6 @@ module Gitlab
user.ldap_block
false
end
- rescue
- false
end
def adapter
diff --git a/lib/gitlab/ldap/adapter.rb b/lib/gitlab/ldap/adapter.rb
index 82cb8cef754..8b38cfaefb6 100644
--- a/lib/gitlab/ldap/adapter.rb
+++ b/lib/gitlab/ldap/adapter.rb
@@ -62,6 +62,9 @@ module Gitlab
results
end
end
+ rescue Net::LDAP::Error => error
+ Rails.logger.warn("LDAP search raised exception #{error.class}: #{error.message}")
+ []
rescue Timeout::Error
Rails.logger.warn("LDAP search timed out after #{config.timeout} seconds")
[]