Production Error Message Text
Permalink
Hi everyone,
Is there any way to change the text that appears for database errors, specifically for when the debug level is set to 'production'? (ie: Dashboard -> Sitewide Settings -> Debug -> Debug Level) I would like to add something simple like 'Please contact xxx at yyy.com or by phone at 000-0000', but I can't seem to find where the text for this message is actually declared!
Is there any way to change the text that appears for database errors, specifically for when the debug level is set to 'production'? (ie: Dashboard -> Sitewide Settings -> Debug -> Debug Level) I would like to add something simple like 'Please contact xxx at yyy.com or by phone at 000-0000', but I can't seem to find where the text for this message is actually declared!
When you're in production mode, no errors are outputted. And I don't think it will be possible to have a standard error when in debug mode because I think it just spits out whatever mysql or php error happens when and where it happens (so there's not one centrally-located error outputting place that you could change). I could be wrong about this last part, though.
You're half-right; while there are no actual errors output in production mode, there is a message to tell the user that something has gone wrong. It reads, 'A database error occurred while processing this request.' I would like to add to that message, 'Please contact blah blah blah.'
Oh, I understand. I just did a search through the codebase, and it looks like the code for that is in concrete/libraries/view.php. In 5.4.1.1 it's on line #799, and in 5.4.2 it's on line #832.
The line is this:
Hope that helps.
The line is this:
$this->renderError(t('An unexpected error occurred.'), t('A database error occurred while processing this request.'), $e);
Hope that helps.
Exactly what I was looking for, thanks boss!