summaryrefslogtreecommitdiffstats
path: root/controller/itemcontroller.php
diff options
context:
space:
mode:
Diffstat (limited to 'controller/itemcontroller.php')
-rw-r--r--controller/itemcontroller.php37
1 files changed, 25 insertions, 12 deletions
diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php
index a4d9abf3f..d19707f90 100644
--- a/controller/itemcontroller.php
+++ b/controller/itemcontroller.php
@@ -104,9 +104,12 @@ class ItemController extends Controller {
* @Ajax
*/
public function star(){
- $this->setStarred(true);
-
- return $this->renderJSON();
+ try {
+ $this->setStarred(true);
+ return $this->renderJSON();
+ } catch(BusinessLayerException $ex) {
+ return $this->renderJSON(array(), $ex->getMessage());
+ }
}
@@ -116,9 +119,12 @@ class ItemController extends Controller {
* @Ajax
*/
public function unstar(){
- $this->setStarred(false);
-
- return $this->renderJSON();
+ try {
+ $this->setStarred(false);
+ return $this->renderJSON();
+ } catch(BusinessLayerException $ex) {
+ return $this->renderJSON(array(), $ex->getMessage());
+ }
}
@@ -129,15 +135,19 @@ class ItemController extends Controller {
$this->itemBusinessLayer->read($itemId, $isRead, $userId);
}
+
/**
* @IsAdminExemption
* @IsSubAdminExemption
* @Ajax
*/
public function read(){
- $this->setRead(true);
-
- return $this->renderJSON();
+ try {
+ $this->setRead(true);
+ return $this->renderJSON();
+ } catch(BusinessLayerException $ex) {
+ return $this->renderJSON(array(), $ex->getMessage());
+ }
}
@@ -147,9 +157,12 @@ class ItemController extends Controller {
* @Ajax
*/
public function unread(){
- $this->setRead(false);
-
- return $this->renderJSON();
+ try {
+ $this->setRead(false);
+ return $this->renderJSON();
+ } catch(BusinessLayerException $ex) {
+ return $this->renderJSON(array(), $ex->getMessage());
+ }
}