Skip to content
Extraits de code Groupes Projets
Valider 3850551e rédigé par Matthieu Napoli's avatar Matthieu Napoli
Parcourir les fichiers

Fixes #7356 Do not catch and silence exceptions blindly

parent 42da3f87
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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)));
}
}
......
<?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
{
}
......@@ -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();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter