Permalink
Browse files

Change return falses to exceptions

  • Loading branch information...
1 parent c909e79 commit ad3d03e6cb6744390b9bb2a3ae47ed3510b7e968 @elkuku committed Apr 6, 2012
@@ -416,19 +416,16 @@ public function getCoreProjects($scope)
/**
* Updates the administration main menu.
*
- * @return boolean
+ * @throws Exception
+ * @return bool
*/
protected function updateAdminMenu()
{
$menu = JRequest::getVar('menu', array());
if( ! isset($menu['text'])
|| ! $menu['text'])
- {
- $this->setError(__METHOD__.' - Empty admin menu');
-
- return false;
- }
+ throw new Exception(__METHOD__.' - Empty admin menu');
switch(ECR_JVERSION)
{
@@ -683,11 +680,12 @@ protected function readMenu()
/**
* Method to remove admin menu references to a component
*
- * @param $row
+ * @param object $row Component table object
*
- * @internal param object $component Component table object
+ * @throws Exception
+ * @internal param object $component
*
- * @return boolean True if successful
+ * @return bool True if successful
*/
protected function removeAdminMenus($row)
{
@@ -730,11 +728,7 @@ protected function removeAdminMenus($row)
foreach($ids as $menuid)
{
if( ! $table->delete((int)$menuid))
- {
- $this->setError($table->getError());
-
- return false;
- }
+ throw new Exception(__METHOD__.' - '.$table->getError());
}//foreach
//-- Rebuild the whole tree
@@ -749,7 +743,8 @@ protected function removeAdminMenus($row)
*
* @param array $item The menu.
*
- * @return boolean true on success
+ * @throws Exception
+ * @return bool true on success
*/
protected function setDbMenuItem($item)
{
@@ -812,11 +807,7 @@ protected function setDbMenuItem($item)
|| ! $table->bind($data)
|| ! $table->check()
|| ! $table->store())
- {
- $this->setError($table->getError());
-
- return false;
- }
+ throw new Exception(__METHOD__.' - '.$table->getError());
$parent_id = $table->id;
@@ -1 +1 @@
-0.0.15.4-55-g8b9a9a1
+0.0.15.4-56-gc909e79

0 comments on commit ad3d03e

Please sign in to comment.