Catch database exception |
Hi,
I have some problems with catching a database exception. On the development, everything works as I expected but not on the production. My code looks like below: PHP Code: try { On the development environment in the logs file, I have only `Duplicate status...` - as I want On the production environment in the logs file, I have a raw exception PHP Code: ERROR - 2020-10-13 20:25:22 --> mysqli_sql_exception: Duplicate entry '441-2' for key 'order_id_status_id' in /var/www/mrsystem/vendor/codeigniter4/framework/system/Database/MySQLi/Connection.php:331 If I changed in the Database config variable DBDebug to TRUE then I have a raw exception and logged a warning PHP Code: ERROR - 2020-10-13 20:25:22 --> mysqli_sql_exception: Duplicate entry '441-2' for key 'order_id_status_id' in /var/www/mrsystem/vendor/codeigniter4/framework/system/Database/MySQLi/Connection.php:331 Can someone tell me what I am doing wrong? How to on the production environment get an only logged warning? |
Messages In This Thread |
Catch database exception - by Michal_PB1 - 10-13-2020, 11:44 AM
RE: Catch database exception - by InsiteFX - 10-13-2020, 02:46 PM
RE: Catch database exception - by Michal_PB1 - 10-14-2020, 07:25 AM
RE: Catch database exception - by InsiteFX - 10-14-2020, 11:33 PM
RE: Catch database exception - by Michal_PB1 - 11-30-2020, 01:13 PM
RE: Catch database exception - by InsiteFX - 11-30-2020, 03:07 PM
RE: Catch database exception - by Michal_PB1 - 11-30-2020, 03:19 PM
|