Log the error with display name

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2016-10-06 11:21:43 +02:00
parent 0ae9a2c9fe
commit 82c29e1204
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 5 additions and 2 deletions

View File

@ -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;