From 77c67a02d0605b9867e2600dabf230af4de484ef Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 22 Feb 2021 19:44:19 +0100 Subject: [PATCH] Catch exception when email is not configured Signed-off-by: Joas Schilling --- lib/Controller/RegisterController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Controller/RegisterController.php b/lib/Controller/RegisterController.php index a3a7438..e495203 100644 --- a/lib/Controller/RegisterController.php +++ b/lib/Controller/RegisterController.php @@ -143,6 +143,8 @@ class RegisterController extends Controller { $this->mailService->sendTokenByMail($registration); } catch (RegistrationException $e) { return $this->showEmailForm($email, $e->getMessage()); + } catch (\Exception $e) { + return $this->showEmailForm($email, $this->l10n->t('A problem occurred sending email, please contact your administrator.')); } return new RedirectResponse( @@ -222,7 +224,7 @@ class RegisterController extends Controller { } catch (RegistrationException $e) { return $this->validateSecretAndTokenErrorPage(); } - + $additional_hint = $this->config->getAppValue('registration', 'additional_hint'); return new TemplateResponse('registration', 'form/user', [