Little cleanup in exceptions.

- Removed duplicated or non-used exceptions.
- Making the error messages more descriptive and stardard.
This commit is contained in:
Renan Gonçalves 2011-10-15 20:06:31 +02:00
parent 3ed712e745
commit 1cf67b1e55
22 changed files with 89 additions and 271 deletions

View file

@ -73,7 +73,7 @@ class ComponentCollection extends ObjectCollection {
* @param string $component Component name to load
* @param array $settings Settings for the component.
* @return Component A component object, Either the existing loaded component or a new one.
* @throws MissingComponentFileException, MissingComponentClassException when the component could not be found
* @throws MissingComponentException when the component could not be found
*/
public function load($component, $settings = array()) {
if (is_array($settings) && isset($settings['className'])) {
@ -90,8 +90,7 @@ class ComponentCollection extends ObjectCollection {
$componentClass = $name . 'Component';
App::uses($componentClass, $plugin . 'Controller/Component');
if (!class_exists($componentClass)) {
throw new MissingComponentClassException(array(
'file' => Inflector::underscore($componentClass) . '.php',
throw new MissingComponentException(array(
'class' => $componentClass
));
}