From 92aff552e0c7f5b33acee9bc2c303c055bc12c03 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sat, 3 Aug 2013 14:37:05 +0200 Subject: [PATCH] Catch exceptions in GroupController --- lib/controller/groupcontroller.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/controller/groupcontroller.php b/lib/controller/groupcontroller.php index 09c20253..2d55cde6 100644 --- a/lib/controller/groupcontroller.php +++ b/lib/controller/groupcontroller.php @@ -86,7 +86,12 @@ class GroupController extends BaseController { } $catman = new \OC_VCategories('contact', $this->api->getUserId()); - $ids = $catman->idsForCategory($name); + try { + $ids = $catman->idsForCategory($name); + } catch(\Exception $e) { + $response->setErrorMessage($e->getMessage()); + return $response; + } if($ids !== false) { $app = new App($this->api->getUserId()); $backend = $app->getBackend('local'); @@ -108,7 +113,11 @@ class GroupController extends BaseController { } } } - $catman->delete($name); + try { + $catman->delete($name); + } catch(\Exception $e) { + $response->setErrorMessage($e->getMessage()); + } return $response; }