New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use exceptions instead of calls to Piwik_ExitWithMessage #6541
Conversation
…exceptions & include HtmlMessageException class for exceptions w/ HTML content in their message.
5b62c02
to
cdb7ed2
Compare
@@ -81,7 +81,7 @@ public static function getDatabaseConfig($dbConfig = null) | |||
*/ | |||
Piwik::postEvent('Db.getDatabaseConfig', array(&$dbConfig)); | |||
|
|||
$dbConfig['profiler'] = $config->Debug['enable_sql_profiler']; | |||
$dbConfig['profiler'] = @$config->Debug['enable_sql_profiler']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why silent fail here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when config fails to be created there is no information in the config structure, but this code path is still executed (because of FrontController::__destruct). Code needs to default value to false in this case.
Nice, less technical debt and code that makes more sense now 👍 |
Use exceptions instead of calls to Piwik_ExitWithMessage. Also includes refactoring Piwik_ExitWithMessage so no echo-ing or exit-ing is done by the function (function is renamed), modification to Log.php so it will work even if config is empty, and, includes event that allows modification of error page contents.
Awesome!
|
As title. Also includes refactoring Piwik_ExitWithMessage so no echo-ing or exit-ing is done by the function (function is renamed). Includes modification to Log.php so it will work even if config is empty. Finally, includes event that allows modification of error page contents.
Thoughts and reviews are welcome (cc @mattab @mnapoli @tsteur ).
Tests I did: