From c6ce1eb557eedca1e1716e6748cbe2a129e7f0e4 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 11 Feb 2021 17:05:51 +0100 Subject: [PATCH] forward invalid argument message to frontend when creating a user fails Signed-off-by: Robin Appelman --- apps/provisioning_api/lib/Controller/UsersController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 34c0135485..f60b618c65 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.',