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

Commit 530daf3f authored by Ronak Patel's avatar Ronak Patel
Browse files

Added exceptions

parent 2184e325
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@ class AccountController extends Controller {
			$response->setData(['message' => 'A server-side error occurred while processing your request! Please try again later.', 'success' => false]);
			$response->setStatus(500);
		} catch (Exception $e) {
			$this->logger->logException($e, ['app' => Application::APP_ID]);
			$response->setData(['message' => 'An error occurred while creating your account!', 'success' => false]);
			$response->setStatus(500);
		}
+2 −5
Original line number Diff line number Diff line
@@ -446,8 +446,7 @@ class UserService {
	public function setAccountDataLocally(string $uid, string $mailAddress, string $quota): void {
		$user = $this->getUser($uid);
		if (is_null($user)) {
			$this->logger->error("User with username '$uid' not found.");
			throw new Exception();
			throw new Exception("User with username '$uid' not found.");
		}
		// Set the email address for the user
		$user->setEMailAddress($mailAddress);
@@ -482,7 +481,6 @@ class UserService {
		if ($statusCode === 200) {
			return true;
		}
		$this->logger->error("Error checking if username '$username' is taken at common source, status code: " . (string) $statusCode);
		throw new Exception("Error checking if username '$username' is taken at common source, status code: " . (string) $statusCode);
	}

@@ -508,8 +506,7 @@ class UserService {
		$this->curl->post($url, $params, $headers);

		if ($this->curl->getLastStatusCode() !== 200) {
			$this->logger->error("Error adding username '$username' to common data store.");
			throw new Exception();
			throw new Exception("Error adding username '$username' to common data store.");
		}
	}
}