Catch exception when email is not configured

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2021-02-22 19:44:19 +01:00
parent df49c483f0
commit 77c67a02d0
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 3 additions and 1 deletions

View File

@ -143,6 +143,8 @@ class RegisterController extends Controller {
$this->mailService->sendTokenByMail($registration); $this->mailService->sendTokenByMail($registration);
} catch (RegistrationException $e) { } catch (RegistrationException $e) {
return $this->showEmailForm($email, $e->getMessage()); 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( return new RedirectResponse(
@ -222,7 +224,7 @@ class RegisterController extends Controller {
} catch (RegistrationException $e) { } catch (RegistrationException $e) {
return $this->validateSecretAndTokenErrorPage(); return $this->validateSecretAndTokenErrorPage();
} }
$additional_hint = $this->config->getAppValue('registration', 'additional_hint'); $additional_hint = $this->config->getAppValue('registration', 'additional_hint');
return new TemplateResponse('registration', 'form/user', [ return new TemplateResponse('registration', 'form/user', [