X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/cc10d1ddfc652f6bcf3bbf61d5ec2e2861394c03..refs/pull/5280/head:/app/Access/UserInviteService.php diff --git a/app/Access/UserInviteService.php b/app/Access/UserInviteService.php index 7d955f385..0b24eb0d9 100644 --- a/app/Access/UserInviteService.php +++ b/app/Access/UserInviteService.php @@ -13,11 +13,17 @@ class UserInviteService extends UserTokenService /** * Send an invitation to a user to sign into BookStack * Removes existing invitation tokens. + * @throws UserInviteException */ public function sendInvitation(User $user) { $this->deleteByUser($user); $token = $this->createTokenForUser($user); - $user->notify(new UserInviteNotification($token)); + + try { + $user->notify(new UserInviteNotification($token)); + } catch (\Exception $exception) { + throw new UserInviteException($exception->getMessage(), $exception->getCode(), $exception); + } } }