Merge pull request #16024 from nextcloud/bugfix/15944/fix-return-code-user-provision

Forward OCSException to initiator
This commit is contained in:
Roeland Jago Douma 2019-06-25 13:32:10 +02:00 committed by GitHub
commit 98244b5d6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -339,13 +339,20 @@ class UsersController extends AUserData {
return new DataResponse(['id' => $userid]);
} catch (HintException $e ) {
} catch (HintException $e) {
$this->logger->logException($e, [
'message' => 'Failed addUser attempt with hint exception.',
'level' => ILogger::WARN,
'app' => 'ocs_api',
]);
throw new OCSException($e->getHint(), 107);
} catch (OCSException $e) {
$this->logger->logException($e, [
'message' => 'Failed addUser attempt with ocs exeption.',
'level' => ILogger::ERROR,
'app' => 'ocs_api',
]);
throw $e;
} catch (\Exception $e) {
$this->logger->logException($e, [
'message' => 'Failed addUser attempt with exception.',