diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2016-05-11 19:41:13 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-05-11 19:41:13 +0200 |
commit | bc1d70f08c4042c457dc3e1bf25c5a34412ac2fb (patch) | |
tree | bb573a3135f533cabddc6fa79e93ba5d1714a2eb /settings/Controller | |
parent | ee0ebd192a394e4f9d4c9dd2c78b1b4d6a211c7a (diff) | |
download | nextcloud-server-bc1d70f08c4042c457dc3e1bf25c5a34412ac2fb.tar.gz nextcloud-server-bc1d70f08c4042c457dc3e1bf25c5a34412ac2fb.zip |
Pass on the error message from the user manager to the UI (#24526)
Diffstat (limited to 'settings/Controller')
-rw-r--r-- | settings/Controller/UsersController.php | 6 |
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 ); |