From 553a981980571930a935a2e85895396f2813ae44 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 5 Jan 2016 11:41:06 +0100 Subject: [PATCH] Make LDAP more robust to exceptions and log them properly --- apps/user_ldap/lib/user/user.php | 2 +- apps/user_ldap/user_ldap.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/user_ldap/lib/user/user.php b/apps/user_ldap/lib/user/user.php index 0dc3c8c0c26..7a121920a35 100644 --- a/apps/user_ldap/lib/user/user.php +++ b/apps/user_ldap/lib/user/user.php @@ -474,8 +474,8 @@ class User { $this->fs->setup($this->uid); } - $avatar = $this->avatarManager->getAvatar($this->uid); try { + $avatar = $this->avatarManager->getAvatar($this->uid); $avatar->set($this->image); } catch (\Exception $e) { \OC::$server->getLogger()->notice( diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php index a266be7b7f7..c568905f3d9 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/user_ldap.php @@ -118,6 +118,7 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn try { $ldapRecord = $this->getLDAPUserByLoginName($uid); } catch(\Exception $e) { + \OC::$server->getLogger()->logException($e, ['app' => 'user_ldap']); return false; } $dn = $ldapRecord['dn'][0]; -- 2.39.5