Merge pull request #16192 from nextcloud/backport/16024/stable15

[stable15] Forward OCSException to initiator
This commit is contained in:
Roeland Jago Douma 2019-07-04 12:22:23 +02:00 committed by GitHub
commit 90a5734242
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -317,13 +317,20 @@ class UsersController extends AUserData {
return new DataResponse();
} 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.',