When _drupal_log_error()
is called with a fatal error, the PHP process exits with a zero:
if (PHP_SAPI === 'cli') {
if ($fatal) {
// When called from CLI, simply output a plain text message.
// Should not translate the string to avoid errors producing more errors.
$response->setContent(html_entity_decode(strip_tags(SafeMarkup::format('%type: @message in %function (line %line of %file).', $error))) . "\n");
$response->send();
exit;
}
}
This causes CLI tools like Behat to exit 0 even though a fatal was raised, confusing CI tools that rely on the exit code.
I'd guess that just exit(1);
would be enough here.