By leonk on
Whenever something goes wrong when Drupal tries to access a database (for example, Drupal can't select the database), a white screen with the Drupal icon and information pertaining to the database connection (username, server name, database name) are displayed. For obvious reasons this is a rather undesirable error screen to have on a live server.
I would like to know if it is possible to override this screen with one that is defined by an administrator (most likely from a custom module). I don't know where this screen gets set in Drupal 5, let alone whether or not it can be overriden by an administrator. Any help is greatly appreciated. Thanks.
Comments
misc/maintenance.css
This CSS file decorates an otherwise very plain error screen, if you customize this stylesheet, you can make the database error screen look a little more like the rest of your site.
not entirely what I'm looking for
matt, I'm less interested at the moment about the style of the page as I am more interested about the content. While the stylesheet will certainly be useful, I am looking more to create a custom error message that lacks sensitive information regarding the database connection so that I'm not blaring that information out to anyone attempting to access the site.
I am intrigued nonetheless by the stylesheet, though. I will be sure to use that once I solve this issue.
no worries, have a look at
no worries,
have a look at the core file: includes/database.mysql.inc
this is where the actual page(s) are generated.
every time an error happens, there is code something like
You would have to edit this file and write your own error display code instead.
Thanks, I'll have a look at
Thanks, I'll have a look at that as soon as I can.
Drupal 6 and Theming
Drupal 6 promises to have theming for maintenance pages such as the error screens mentioned above.
http://drupal.org/node/141727
I'm not sure if there is anything official on this yet as of this posting, but it seems like this will get added to Drupal 6 at some point (if it hasn't already).