Merge pull request #8516 from nextcloud/12-8502
[stable12] Show hint in OCS API for user creation
This commit is contained in:
commit
4ca227577f
|
@ -30,6 +30,7 @@
|
|||
namespace OCA\Provisioning_API\Controller;
|
||||
|
||||
use OC\Accounts\AccountManager;
|
||||
use OC\HintException;
|
||||
use OC\Settings\Mailer\NewUserMailHelper;
|
||||
use OC_Helper;
|
||||
use OCP\App\IAppManager;
|
||||
|
@ -195,6 +196,13 @@ class UsersController extends OCSController {
|
|||
}
|
||||
}
|
||||
return new DataResponse();
|
||||
} catch (HintException $e ) {
|
||||
$this->logger->logException($e, [
|
||||
'message' => 'Failed addUser attempt with hint exception.',
|
||||
'level' => \OCP\Util::WARN,
|
||||
'app' => 'ocs_api',
|
||||
]);
|
||||
throw new OCSException($e->getHint(), 107);
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->error('Failed addUser attempt with exception: '.$e->getMessage(), ['app' => 'ocs_api']);
|
||||
throw new OCSException('Bad request', 101);
|
||||
|
|
Loading…
Reference in New Issue