We have Cloudflare sitting in front of our Drupal sites - and in order to take advantage of their "AlwaysOnline" feature - we need to alter the response code sent in the event of an error.
I want to cater for when the database is unavailable - as this can sometimes happen when upgrading the MySQL server.
The only way I've found so far is to hack the errors.inc file:
if ($fatal) {
drupal_add_http_header('Status', '504 Service unavailable (with message)');
}
Is there a more elegant way to achieve what I'm after?