Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50900c5b authored by Ronak Patel's avatar Ronak Patel
Browse files

adding try catch

parent 69fd6384
Loading
Loading
Loading
Loading
Loading
+25 −19
Original line number Diff line number Diff line
@@ -291,6 +291,7 @@ class UserService {
		
		$newUserDN = "username=$username," . $base;
		$quota = $this->LDAPConnectionService->getLdapQuota() * 1024 * 1024;
		try {
			$newUserEntry = [
				'mailAddress' => $userEmail,
				'username' => $username,
@@ -311,6 +312,11 @@ class UserService {
				throw new LDAPUserCreationException("Error while adding entry to LDAP for username: " .  $username . ' Error: ' . ldap_error($connection), ldap_errno($connection));
			}
			return $newUserEntry;
		} catch (LDAPUserCreationException $e) {
			throw $e;
		} catch (Exception $e) {
			throw $e;
		}
	}
	/**
	 * Check if a recovery email address is available (not already taken by another user).