This looks to be the case of where the documentation is out-of-date. That comment has been around verbatim since D7. D8 doesn't produce a themed maintenance page like D7.
When looking at _drupal_log_error()
, you can see that unless Drupal is going through the install process, a fatal error will output a bare error message with a 500 status then exit:
if ($fatal) {
// We fallback to a maintenance page at this point, because the page generation
// itself can generate errors.
// Should not translate the string to avoid errors producing more errors.
$message = 'The website encountered an unexpected error. Please try again later.' . '<br />' . $message;
if ($is_installer) {
// install_display_output() prints the output and ends script execution.
$output = array(
'#title' => 'Error',
'#markup' => $message,
);
install_display_output($output, $GLOBALS['install_state'], $response->headers->all());
exit;
}
$response->setContent($message);
$response->setStatusCode(500, '500 Service unavailable (with message)');
$response->send();
// An exception must halt script execution.
exit;
}
Whereas in D7, _drupal_log_error()
passes through a themed maintenance page:
if ($fatal) {
drupal_set_title(t('Error'));
// We fallback to a maintenance page at this point, because the page generation
// itself can generate errors.
print theme('maintenance_page', array('content' => t('The website encountered an unexpected error. Please try again later.')));
exit;
}