aboutsummaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-02-11 17:05:51 +0100
committerRobin Appelman <robin@icewind.nl>2021-02-11 17:05:51 +0100
commitc6ce1eb557eedca1e1716e6748cbe2a129e7f0e4 (patch)
treec2260981fd58b47e00c7b24afff1e6bd40d0f063 /apps/provisioning_api
parent5babad4f6fb983709e7851bb5cea4bc0d2c7fe4c (diff)
downloadnextcloud-server-c6ce1eb557eedca1e1716e6748cbe2a129e7f0e4.tar.gz
nextcloud-server-c6ce1eb557eedca1e1716e6748cbe2a129e7f0e4.zip
forward invalid argument message to frontend when creating a user fails
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index 34c0135485f..f60b618c65f 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -441,6 +441,13 @@ class UsersController extends AUserData {
'app' => 'ocs_api',
]);
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->logException($e, [
'message' => 'Failed addUser attempt with exception.',