diff --git a/core/Config.php b/core/Config.php index e28f581ea898ba0835b2cef7b08f6db18de85dea..f0b5c3ed264d09f97313bab6b586f827776df57e 100644 --- a/core/Config.php +++ b/core/Config.php @@ -10,6 +10,7 @@ namespace Piwik; use Exception; +use Piwik\Config\ConfigNotFoundException; use Piwik\Ini\IniReader; use Piwik\Ini\IniReadingException; use Piwik\Ini\IniWriter; @@ -370,7 +371,7 @@ class Config extends Singleton public function checkLocalConfigFound() { if (!$this->existsLocalConfig()) { - throw new Exception(Piwik::translate('General_ExceptionConfigurationFileNotFound', array($this->pathLocal))); + throw new ConfigNotFoundException(Piwik::translate('General_ExceptionConfigurationFileNotFound', array($this->pathLocal))); } } diff --git a/core/Config/ConfigNotFoundException.php b/core/Config/ConfigNotFoundException.php new file mode 100644 index 0000000000000000000000000000000000000000..5860367ba73227f2fbd263d1f2e33b9ae45fc829 --- /dev/null +++ b/core/Config/ConfigNotFoundException.php @@ -0,0 +1,16 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +namespace Piwik\Config; + +/** + * Exception thrown when the config file doesn't exist. + */ +class ConfigNotFoundException extends \Exception +{ +} diff --git a/core/Console.php b/core/Console.php index 02e5f8687130bd4b54354dac1c8b85fbbd9757f1..fac27d80360388ba6ff3c9a8ba6e1dd6fe9c8081 100644 --- a/core/Console.php +++ b/core/Console.php @@ -8,6 +8,7 @@ */ namespace Piwik; +use Piwik\Config\ConfigNotFoundException; use Piwik\Container\StaticContainer; use Piwik\Plugin\Manager as PluginManager; use Symfony\Bridge\Monolog\Handler\ConsoleHandler; @@ -43,10 +44,9 @@ class Console extends Application try { self::initPlugins(); - } catch(\Exception $e) { + } catch (ConfigNotFoundException $e) { // Piwik not installed yet, no config file? - - Log::debug("Could not initialize plugins: " . $e->getMessage() . "\n" . $e->getTraceAsString()); + Log::warning($e->getMessage()); } $commands = $this->getAvailableCommands();