forward invalid argument message to frontend when creating a user fails

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/25589/head
Robin Appelman 5 years ago
parent 5babad4f6f
commit c6ce1eb557
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
  1. 7
      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.',

Loading…
Cancel
Save