mirror of
https://github.com/nextcloud/server.git
synced 2026-03-21 10:00:33 -04:00
Pass on the error message from the user manager to the UI (#24526)
This commit is contained in:
parent
ee0ebd192a
commit
bc1d70f08c
2 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||
);
|
||||
|
|
|
|||
|
|
@ -840,7 +840,7 @@ $(document).ready(function () {
|
|||
}).fail(function(result) {
|
||||
OC.Notification.showTemporary(t('settings', 'Error creating user: {message}', {
|
||||
message: result.responseJSON.message
|
||||
}));
|
||||
}, undefined, {escape: false}));
|
||||
}).success(function(){
|
||||
$('#newuser').get(0).reset();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue