Commit f5b0b26e authored by alexpott's avatar alexpott

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

parent 50dfcc70
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment