In a CakePHP application, if there is any SQL error and debug level is set to greater than 0, then the complete error message from the database is displayed on the screen, but if the debug is set to 0 it just gives something like “unable to add” or worse a blank page. This can be very frustrating for the end users. How do you gracefully handle SQL errors with debug level set to 0? Well, CakePHP ha