Fix provisioning API call

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-03-20 10:30:46 +01:00
parent 591e75df5c
commit 3abe86dade
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 8 additions and 1 deletions

View File

@ -26,7 +26,9 @@
namespace OCA\Provisioning_API\Controller;
use \OC_App;
use OCP\App\AppPathNotFoundException;
use OCP\App\IAppManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSException;
use OCP\AppFramework\OCSController;
@ -99,9 +101,14 @@ class AppsController extends OCSController {
* @PasswordConfirmationRequired
* @param string $app
* @return DataResponse
* @throws OCSException
*/
public function enable($app) {
$this->appManager->enableApp($app);
try {
$this->appManager->enableApp($app);
} catch (AppPathNotFoundException $e) {
throw new OCSException('The request app was not found', \OCP\API::RESPOND_NOT_FOUND);
}
return new DataResponse();
}