diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 5eaa05e..39aed5e 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -3473,6 +3473,10 @@ function _drupal_shutdown_function() {
     }
   }
   catch (Exception $exception) {
+    // In case this exception is e.g. caused by an error in a shutdown function involving saving of a node,
+    // unset the Location header so the user can actually see it. Also, set a HTTP 500 error code.
+    header_remove("Location");
+    header("HTTP/1.0 500 Internal Server Error");
     // If we are displaying errors, then do so with no possibility of a further uncaught exception being thrown.
    require_once DRUPAL_ROOT . '/includes/errors.inc';
    if (error_displayable()) {
