From e99346ee98d83d1eedf06189f11b127c5615b6f9 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Mon, 18 Oct 2010 15:22:45 +0200 Subject: [PATCH] Improved error handling. --- components/lib/Components.php | 2 +- components/lib/Components/Pear/InstallLocation.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/lib/Components.php b/components/lib/Components.php index 3d6db5b06..eb9ec43c1 100644 --- a/components/lib/Components.php +++ b/components/lib/Components.php @@ -63,7 +63,7 @@ class Components $module->handle($config); } } catch (Components_Exception $e) { - $dependencies->getOutput()->fail($e->getMessage()); + $dependencies->getOutput()->fail($e); return; } } diff --git a/components/lib/Components/Pear/InstallLocation.php b/components/lib/Components/Pear/InstallLocation.php index 52987203b..f076efa84 100644 --- a/components/lib/Components/Pear/InstallLocation.php +++ b/components/lib/Components/Pear/InstallLocation.php @@ -201,7 +201,11 @@ class Components_Pear_InstallLocation if (!file_exists($this->_config_file)) { $this->createPearConfig(); } - return PEAR_Config::singleton($this->_config_file); + $config = PEAR_Config::singleton($this->_config_file); + if ($config instanceOf PEAR_Error) { + throw new Components_Exception($config->getMessage()); + } + return $config; } /** -- 2.11.0