Catch LoginException

This commit is contained in:
Roeland Jago Douma 2016-07-21 22:47:20 +02:00
parent 4b4990c48f
commit 8ae49183c1
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
1 changed files with 2 additions and 0 deletions

View File

@ -85,6 +85,8 @@ try {
OC_Response::setStatus(405);
} catch (\OC\OCS\Exception $ex) {
OC_API::respond($ex->getResult(), OC_API::requestedFormat());
} catch (\OC\User\LoginException $e) {
OC_API::respond(new OC_OCS_Result(null, \OCP\API::RESPOND_UNAUTHORISED, 'Unauthorised'));
} catch (\Exception $e) {
OC_API::setContentType();
OC_OCS::notFound();