summaryrefslogtreecommitdiffstats
path: root/settings/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'settings/Controller')
-rw-r--r--settings/Controller/UsersController.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php
index f5b7f2d2e5d..5f74eaa82fb 100644
--- a/settings/Controller/UsersController.php
+++ b/settings/Controller/UsersController.php
@@ -355,9 +355,13 @@ class UsersController extends Controller {
try {
$user = $this->userManager->createUser($username, $password);
} catch (\Exception $exception) {
+ $message = $exception->getMessage();
+ if (!$message) {
+ $message = $this->l10n->t('Unable to create user.');
+ }
return new DataResponse(
array(
- 'message' => (string)$this->l10n->t('Unable to create user.')
+ 'message' => (string) $message,
),
Http::STATUS_FORBIDDEN
);