]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not fail hard on new user mail error 16189/head
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Tue, 2 Jul 2019 06:04:56 +0000 (08:04 +0200)
committerBackportbot <backportbot-noreply@rullzer.com>
Tue, 2 Jul 2019 09:54:35 +0000 (09:54 +0000)
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
apps/provisioning_api/lib/Controller/UsersController.php

index b993188c97e1ae5d0a237338b6fd173baf09d8da..55ba5cfc66c816730e7c21ac1fe8ad6f1d569b61 100644 (file)
@@ -306,12 +306,13 @@ class UsersController extends AUserData {
                                        $emailTemplate = $this->newUserMailHelper->generateTemplate($newUser, $generatePasswordResetToken);
                                        $this->newUserMailHelper->sendMail($newUser, $emailTemplate);
                                } catch (\Exception $e) {
+                                       // Mail could be failing hard or just be plain not configured
+                                       // Logging error as it is the hardest of the two
                                        $this->logger->logException($e, [
-                                               'message' => "Can't send new user mail to $email",
+                                               'message' => "Unable to send the invitation mail to $email",
                                                'level' => ILogger::ERROR,
                                                'app' => 'ocs_api',
                                        ]);
-                                       throw new OCSException('Unable to send the invitation mail', 109);
                                }
                        }