From 82c29e120404d8fe731e766c1fcd072072765943 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 6 Oct 2016 11:21:43 +0200 Subject: [PATCH] Log the error with display name Signed-off-by: Joas Schilling --- apps/user_ldap/lib/User/User.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index 51fd577104..b2fcac1064 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/apps/user_ldap/lib/User/User.php @@ -33,6 +33,7 @@ use OCP\IAvatarManager; use OCP\IConfig; use OCP\Image; use OCP\IUserManager; +use OCP\Util; /** * User @@ -113,9 +114,11 @@ class User { LogWrapper $log, IAvatarManager $avatarManager, IUserManager $userManager) { if ($username === null) { - throw new \InvalidArgumentException("uid for '$dn' must not be null!"); + $log->log("uid for '$dn' must not be null!", Util::ERROR); + throw new \InvalidArgumentException('uid must not be null!'); } else if ($username === '') { - throw new \InvalidArgumentException("uid for '$dn' must not be an empty string!"); + $log->log("uid for '$dn' must not be an empty string", Util::ERROR); + throw new \InvalidArgumentException('uid must not be an empty string!'); } $this->access = $access;