Skip to content

Commit

Permalink
Throwing Exception instead of try-catch block
Browse files Browse the repository at this point in the history
Signed-off-by: Buddhima Wijeweera <buddhimawijeweera@yahoo.com>
  • Loading branch information
Buddhima committed Apr 1, 2012
1 parent deb68e1 commit a89332b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions libraries/joomla/html/editor.php
Expand Up @@ -454,20 +454,17 @@ public function getButtons($editor, $buttons = true)
{
$plugin = new $className($this, (array) $plugin);
}

try
else
{
throw new Exception("Class does not exists "+$className);
}

// Try to authenticate
// Unsafe operation, might cause an exception if $className not exists
if ($temp = $plugin->onDisplay($editor, $this->asset, $this->author))
{
$result[] = $temp;
}
}catch (Exception $e)
{
echo 'Exception while authenticating';
echo 'Message ' . $e->getMessage(); //Print the error message
}

}

return $result;
Expand Down

0 comments on commit a89332b

Please sign in to comment.