From 3f2d14327cb28b003fd93bcf159b7a305f95ae8a Mon Sep 17 00:00:00 2001 From: odumasFR <37532391+odumasFR@users.noreply.github.com> Date: Mon, 1 Oct 2018 23:08:45 +0200 Subject: [PATCH] better exception handling for ldap errors --- app/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index 3ad1043..db0a23f 100644 --- a/app/models.py +++ b/app/models.py @@ -176,7 +176,7 @@ class User(db.Model): for member in group[0][1]['memberOf']: result += self.ad_recursive_groups( member.decode("utf-8") ) return result - except: + except ldap.LDAPError as e: logging.exception("Recursive AD Group search error") return result