Improved error handling.
authorGunnar Wrobel <p@rdus.de>
Mon, 18 Oct 2010 13:22:45 +0000 (15:22 +0200)
committerGunnar Wrobel <p@rdus.de>
Mon, 18 Oct 2010 13:22:45 +0000 (15:22 +0200)
components/lib/Components.php
components/lib/Components/Pear/InstallLocation.php

index 3d6db5b..eb9ec43 100644 (file)
@@ -63,7 +63,7 @@ class Components
                 $module->handle($config);
             }
         } catch (Components_Exception $e) {
-            $dependencies->getOutput()->fail($e->getMessage());
+            $dependencies->getOutput()->fail($e);
             return;
         }
     }
index 5298720..f076efa 100644 (file)
@@ -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;
     }
 
     /**