Merge pull request #25589 from nextcloud/provisioning-api-invalid-argument

forward invalid argument message to frontend when creating a user fails
This commit is contained in:
Roeland Jago Douma 2021-03-05 08:59:50 +01:00 committed by GitHub
commit 4a9f3ef232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -445,6 +445,13 @@ class UsersController extends AUserData {
]
);
throw $e;
} catch (\InvalidArgumentException $e) {
$this->logger->logException($e, [
'message' => 'Failed addUser attempt with invalid argument exeption.',
'level' => ILogger::ERROR,
'app' => 'ocs_api',
]);
throw new OCSException($e->getMessage(), 101);
} catch (\Exception $e) {
$this->logger->error('Failed addUser attempt with exception.',
[