Merge pull request #274 from nextcloud/bugfix/267/catch-exception-when-email-is-not-configured

Catch exception when email is not configured
This commit is contained in:
Joas Schilling 2021-02-23 08:25:01 +01:00 committed by GitHub
commit 18c8d3995d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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', [