]> BookStack Code Mirror - bookstack/blobdiff - app/Access/UserInviteService.php
respective book and chapter structure added.
[bookstack] / app / Access / UserInviteService.php
index 7d955f3851d763c199a0073f05c2d4a3e1366ef7..0b24eb0d9ebaa4597a476fe762f9c1404a7bdc07 100644 (file)
@@ -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);
+        }
     }
 }