-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Dev: Database config that always throws Exceptions #6132
Comments
@MGatner I've checked all And I found that if I always want Exceptions thrown, all I need to do is this: --- a/app/Config/Database.php
+++ b/app/Config/Database.php
@@ -39,7 +39,7 @@ class Database extends Config
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
- 'DBDebug' => (ENVIRONMENT !== 'production'),
+ 'DBDebug' => true,
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '', The only issue is the name of the property --- a/system/Database/BaseConnection.php
+++ b/system/Database/BaseConnection.php
@@ -124,7 +124,7 @@ abstract class BaseConnection implements ConnectionInterface
/**
* Debug flag
*
- * Whether to display error messages.
+ * Whether to throw Exception or not when an error occurs.
*
* @var bool
*/ |
Oh nice! That's a lot easier than I expected. Yes I will switch all my projects to I agree the name is unfortunate but probably not worth fiddling with if the functionality is all there. |
Yes, |
Now in the
development
environment CI throws Exceptions when DB errors occur,but in the
production
environment, CI returns false.So most devs don't check query return values, and DB errors in the production environment
will be hidden by the configuration.
See #6115 (comment)
Ref
The text was updated successfully, but these errors were encountered: