summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/provisioning_api/lib')
-rw-r--r--apps/provisioning_api/lib/Controller/AppsController.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/provisioning_api/lib/Controller/AppsController.php b/apps/provisioning_api/lib/Controller/AppsController.php
index e384d5af907..1165c7b8564 100644
--- a/apps/provisioning_api/lib/Controller/AppsController.php
+++ b/apps/provisioning_api/lib/Controller/AppsController.php
@@ -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();
}