Skip to content
Snippets Groups Projects
Commit f5b0b26e authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2325385 by dawehner: Fixed Ensure that the error handler does not throw exception itself.

parent 50dfcc70
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -157,7 +157,12 @@ function _drupal_log_error($error, $fatal = FALSE) {
$number++;
}
\Drupal::logger('php')->log($error['severity_level'], '%type: !message in %function (line %line of %file).', $error);
// Only call the logger if there is a logger factory available. This can occur
// if there is an error while rebuilding the container or during the
// installer.
if (\Drupal::hasService('logger.factory')) {
\Drupal::logger('php')->log($error['severity_level'], '%type: !message in %function (line %line of %file).', $error);
}
if (PHP_SAPI === 'cli') {
if ($fatal) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment