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

Commit 5e77a140 authored by Ronak Patel's avatar Ronak Patel
Browse files

added exception

parent 8f30683d
Loading
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -201,15 +201,10 @@ class UserService {
			$sendgrid = new \SendGrid($sendgridAPIkey);
			$response = $sendgrid->send($email);
	
			if ($response->statusCode() === 200) {
				return true;
			} else {
				$this->logger->error(
					"Error while sending sendEmailWithSendGrid: SendGrid API error - Status Code: " . $response->statusCode(),
					['app' => Application::APP_ID]
				);
				return false;
			if ($response->statusCode() !== 200) {
				throw new \Exception("SendGrid API error - Status Code: " . $response->statusCode());
			}
			return true;
		} catch (\Exception $e) {
			$this->logger->error(
				"Error while sending sendEmailWithSendGrid: " . $e->getMessage(),