summaryrefslogtreecommitdiffstats
path: root/controller/foldercontroller.php
diff options
context:
space:
mode:
Diffstat (limited to 'controller/foldercontroller.php')
-rw-r--r--controller/foldercontroller.php25
1 files changed, 18 insertions, 7 deletions
diff --git a/controller/foldercontroller.php b/controller/foldercontroller.php
index f7934ae67..f8d99410d 100644
--- a/controller/foldercontroller.php
+++ b/controller/foldercontroller.php
@@ -71,8 +71,12 @@ class FolderController extends Controller {
* @Ajax
*/
public function open(){
- $this->setOpened(true);
- return $this->renderJSON();
+ try {
+ $this->setOpened(true);
+ return $this->renderJSON();
+ } catch(BusinessLayerException $ex) {
+ return $this->renderJSON(array(), $ex->getMessage());
+ }
}
@@ -82,8 +86,12 @@ class FolderController extends Controller {
* @Ajax
*/
public function collapse(){
- $this->setOpened(false);
- return $this->renderJSON();
+ try {
+ $this->setOpened(false);
+ return $this->renderJSON();
+ } catch(BusinessLayerException $ex) {
+ return $this->renderJSON(array(), $ex->getMessage());
+ }
}
@@ -121,9 +129,12 @@ class FolderController extends Controller {
$userId = $this->api->getUserId();
$folderId = (int) $this->params('folderId');
- $this->folderBusinessLayer->delete($folderId, $userId);
-
- return $this->renderJSON();
+ try {
+ $this->folderBusinessLayer->delete($folderId, $userId);
+ return $this->renderJSON();
+ } catch (BusinessLayerException $ex){
+ return $this->renderJSON(array(), $ex->getMessage());
+ }
}