summaryrefslogtreecommitdiffstats
path: root/settings/Controller/MailSettingsController.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-04-18 16:08:29 +0200
committerJoas Schilling <coding@schilljs.com>2017-04-18 16:08:29 +0200
commitdfca672378d2083e498706c16b2a60981439cc0d (patch)
treebca05849a86192d6e68d28ee3125ed97d1dc180a /settings/Controller/MailSettingsController.php
parenta5b4308a517a66b320ba69be8604144ce74f417e (diff)
downloadnextcloud-server-dfca672378d2083e498706c16b2a60981439cc0d.tar.gz
nextcloud-server-dfca672378d2083e498706c16b2a60981439cc0d.zip
Fix tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'settings/Controller/MailSettingsController.php')
-rw-r--r--settings/Controller/MailSettingsController.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/settings/Controller/MailSettingsController.php b/settings/Controller/MailSettingsController.php
index b66c63cfcb6..caba4bad0b0 100644
--- a/settings/Controller/MailSettingsController.php
+++ b/settings/Controller/MailSettingsController.php
@@ -138,7 +138,7 @@ class MailSettingsController extends Controller {
/**
* Send a mail to test the settings
- * @return array|DataResponse
+ * @return DataResponse
*/
public function sendTestMail() {
$email = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'email', '');
@@ -153,14 +153,13 @@ class MailSettingsController extends Controller {
if (!empty($errors)) {
throw new \RuntimeException($this->l10n->t('Mail could not be sent. Check your mail server log'));
}
+ return new DataResponse();
} catch (\Exception $e) {
- return new DataResponse($this->l10n->t('A problem occurred while sending the email. Please revise your settings. (Error: %s)', [$e->getMessage()]));
+ return new DataResponse($this->l10n->t('A problem occurred while sending the email. Please revise your settings. (Error: %s)', [$e->getMessage()]), Http::STATUS_BAD_REQUEST);
}
-
- return new DataResponse();
}
- return new DataResponse($this->l10n->t('You need to set your user email before being able to send test emails.'));
+ return new DataResponse($this->l10n->t('You need to set your user email before being able to send test emails.'), Http::STATUS_BAD_REQUEST);
}
}