I know this thread is outdated, but just in case anyone else has this problem. This is the trick I used without touching the CI db classes. Leave your debug file and in your error viewer, highlight the exception.
So, you have db config, you have:
$db['default']['db_debug'] = true;
Then in your db error presentation file mine is in application/errors/error_db.php , replace all the contents as follows:
<?php $message = preg_replace('/(<\/?p>)+/', ' ', $message); throw new Exception("Database error occured with message : {$message}"); ?>
Since the view file will be called, the error will always be selected as an exception, later you can add different views for different environments.
tlogbon Dec 19 '14 at 12:47 2014-12-19 12:47
source share