When the backend database is unavailable for whatever reason, drupal returns "Additional uncaught exception thrown while handling exception" which is fine but is returns it as a status 200.

Is there a way to make this return this as a status 500 ? This way I can have Varnish put up a more friendlier error message ?

Comments

sam moore’s picture

Does your error page have a distinct enough URL to do this with a rewrite in .htaccess?
I'm thinking of something like
RewriteCond %{REQUEST_URI} !^/mysite.com/myerrorpage
RewriteRule ^(.*)$ mysite.com/myerrorpage [R=500,L]

Note that I'm not at all sure this will work , and the syntax may be a little off - please test on a dev instance first.

pol’s picture

Hi,

The patch has been committed today in Drupal 7, see: https://gitlab.com/drupol/drupal/commit/e66fb070786ff869f6a1c83f424f6def...