Loading core/includes/bootstrap.inc +1 −1 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ function watchdog_exception($type, Exception $exception, $message = NULL, $varia // Use a default value if $message is not set. if (empty($message)) { $message = '%type: @message in %function (line %line of %file).'; $message = Error::DEFAULT_ERROR_MESSAGE; } if ($link) { Loading core/includes/errors.inc +5 −5 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ function _drupal_log_error($error, $fatal = FALSE) { catch (\Exception $e) { // We can't log, for example because the database connection is not // available. At least try to log to PHP error log. error_log(strtr('Failed to log error: %type: @message in %function (line %line of %file). @backtrace_string', $error)); error_log(strtr('Failed to log error: ' . Error::DEFAULT_ERROR_MESSAGE . ' @backtrace_string', $error)); } } Loading @@ -190,7 +190,7 @@ function _drupal_log_error($error, $fatal = FALSE) { 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(new FormattableMarkup('%type: @message in %function (line %line of %file).', $error))) . "\n"); $response->setContent(html_entity_decode(strip_tags(new FormattableMarkup(Error::DEFAULT_ERROR_MESSAGE, $error))) . "\n"); $response->send(); exit(1); } Loading @@ -201,7 +201,7 @@ function _drupal_log_error($error, $fatal = FALSE) { if (error_displayable($error)) { // When called from JavaScript, simply output the error message. // Should not translate the string to avoid errors producing more errors. $response->setContent(new FormattableMarkup('%type: @message in %function (line %line of %file).', $error)); $response->setContent(new FormattableMarkup(Error::DEFAULT_ERROR_MESSAGE, $error)); $response->send(); } exit; Loading Loading @@ -240,7 +240,7 @@ function _drupal_log_error($error, $fatal = FALSE) { // We use \Drupal\Component\Render\FormattableMarkup directly here, // rather than use t() since we are in the middle of error handling, and // we don't want t() to cause further errors. $message = new FormattableMarkup('%type: @message in %function (line %line of %file).', $error); $message = new FormattableMarkup(Error::DEFAULT_ERROR_MESSAGE, $error); } else { // With verbose logging, we will also include a backtrace. Loading @@ -252,7 +252,7 @@ function _drupal_log_error($error, $fatal = FALSE) { array_shift($backtrace); // Generate a backtrace containing only scalar argument values. $error['@backtrace'] = Error::formatBacktrace($backtrace); $message = new FormattableMarkup('%type: @message in %function (line %line of %file). <pre class="backtrace">@backtrace</pre>', $error); $message = new FormattableMarkup(Error::DEFAULT_ERROR_MESSAGE . ' <pre class="backtrace">@backtrace</pre>', $error); } } Loading core/includes/update.inc +2 −2 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ function update_do_one($module, $number, $dependency_map, &$context) { $variables = Error::decodeException($e); unset($variables['backtrace'], $variables['exception'], $variables['severity_level']); $ret['#abort'] = ['success' => FALSE, 'query' => t('%type: @message in %function (line %line of %file).', $variables)]; $ret['#abort'] = ['success' => FALSE, 'query' => t(Error::DEFAULT_ERROR_MESSAGE, $variables)]; } } Loading Loading @@ -308,7 +308,7 @@ function update_invoke_post_update($function, &$context) { unset($variables['backtrace'], $variables['exception']); $ret['#abort'] = [ 'success' => FALSE, 'query' => t('%type: @message in %function (line %line of %file).', $variables), 'query' => t(Error::DEFAULT_ERROR_MESSAGE, $variables), ]; } } Loading core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php +1 −1 Original line number Diff line number Diff line Loading @@ -190,7 +190,7 @@ protected function makeSubrequest(ExceptionEvent $event, $url, $status_code) { // just log it. The DefaultExceptionSubscriber will catch the original // exception and handle it normally. $error = Error::decodeException($e); $this->logger->log($error['severity_level'], '%type: @message in %function (line %line of %file).', $error); $this->logger->log($error['severity_level'], Error::DEFAULT_ERROR_MESSAGE, $error); } } Loading core/lib/Drupal/Core/EventSubscriber/ExceptionLoggingSubscriber.php +2 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public function on403(ExceptionEvent $event) { $error = Error::decodeException($exception); unset($error['@backtrace_string']); $error['@uri'] = $event->getRequest()->getRequestUri(); $this->logger->get('access denied')->warning('Path: @uri. %type: @message in %function (line %line of %file).', $error); $this->logger->get('access denied')->warning('Path: @uri. ' . Error::DEFAULT_ERROR_MESSAGE, $error); } /** Loading @@ -67,7 +67,7 @@ public function on404(ExceptionEvent $event) { public function onError(ExceptionEvent $event) { $exception = $event->getThrowable(); $error = Error::decodeException($exception); $this->logger->get('php')->log($error['severity_level'], '%type: @message in %function (line %line of %file).', $error); $this->logger->get('php')->log($error['severity_level'], Error::DEFAULT_ERROR_MESSAGE, $error); $is_critical = !$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500; if ($is_critical) { Loading Loading
core/includes/bootstrap.inc +1 −1 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ function watchdog_exception($type, Exception $exception, $message = NULL, $varia // Use a default value if $message is not set. if (empty($message)) { $message = '%type: @message in %function (line %line of %file).'; $message = Error::DEFAULT_ERROR_MESSAGE; } if ($link) { Loading
core/includes/errors.inc +5 −5 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ function _drupal_log_error($error, $fatal = FALSE) { catch (\Exception $e) { // We can't log, for example because the database connection is not // available. At least try to log to PHP error log. error_log(strtr('Failed to log error: %type: @message in %function (line %line of %file). @backtrace_string', $error)); error_log(strtr('Failed to log error: ' . Error::DEFAULT_ERROR_MESSAGE . ' @backtrace_string', $error)); } } Loading @@ -190,7 +190,7 @@ function _drupal_log_error($error, $fatal = FALSE) { 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(new FormattableMarkup('%type: @message in %function (line %line of %file).', $error))) . "\n"); $response->setContent(html_entity_decode(strip_tags(new FormattableMarkup(Error::DEFAULT_ERROR_MESSAGE, $error))) . "\n"); $response->send(); exit(1); } Loading @@ -201,7 +201,7 @@ function _drupal_log_error($error, $fatal = FALSE) { if (error_displayable($error)) { // When called from JavaScript, simply output the error message. // Should not translate the string to avoid errors producing more errors. $response->setContent(new FormattableMarkup('%type: @message in %function (line %line of %file).', $error)); $response->setContent(new FormattableMarkup(Error::DEFAULT_ERROR_MESSAGE, $error)); $response->send(); } exit; Loading Loading @@ -240,7 +240,7 @@ function _drupal_log_error($error, $fatal = FALSE) { // We use \Drupal\Component\Render\FormattableMarkup directly here, // rather than use t() since we are in the middle of error handling, and // we don't want t() to cause further errors. $message = new FormattableMarkup('%type: @message in %function (line %line of %file).', $error); $message = new FormattableMarkup(Error::DEFAULT_ERROR_MESSAGE, $error); } else { // With verbose logging, we will also include a backtrace. Loading @@ -252,7 +252,7 @@ function _drupal_log_error($error, $fatal = FALSE) { array_shift($backtrace); // Generate a backtrace containing only scalar argument values. $error['@backtrace'] = Error::formatBacktrace($backtrace); $message = new FormattableMarkup('%type: @message in %function (line %line of %file). <pre class="backtrace">@backtrace</pre>', $error); $message = new FormattableMarkup(Error::DEFAULT_ERROR_MESSAGE . ' <pre class="backtrace">@backtrace</pre>', $error); } } Loading
core/includes/update.inc +2 −2 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ function update_do_one($module, $number, $dependency_map, &$context) { $variables = Error::decodeException($e); unset($variables['backtrace'], $variables['exception'], $variables['severity_level']); $ret['#abort'] = ['success' => FALSE, 'query' => t('%type: @message in %function (line %line of %file).', $variables)]; $ret['#abort'] = ['success' => FALSE, 'query' => t(Error::DEFAULT_ERROR_MESSAGE, $variables)]; } } Loading Loading @@ -308,7 +308,7 @@ function update_invoke_post_update($function, &$context) { unset($variables['backtrace'], $variables['exception']); $ret['#abort'] = [ 'success' => FALSE, 'query' => t('%type: @message in %function (line %line of %file).', $variables), 'query' => t(Error::DEFAULT_ERROR_MESSAGE, $variables), ]; } } Loading
core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php +1 −1 Original line number Diff line number Diff line Loading @@ -190,7 +190,7 @@ protected function makeSubrequest(ExceptionEvent $event, $url, $status_code) { // just log it. The DefaultExceptionSubscriber will catch the original // exception and handle it normally. $error = Error::decodeException($e); $this->logger->log($error['severity_level'], '%type: @message in %function (line %line of %file).', $error); $this->logger->log($error['severity_level'], Error::DEFAULT_ERROR_MESSAGE, $error); } } Loading
core/lib/Drupal/Core/EventSubscriber/ExceptionLoggingSubscriber.php +2 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public function on403(ExceptionEvent $event) { $error = Error::decodeException($exception); unset($error['@backtrace_string']); $error['@uri'] = $event->getRequest()->getRequestUri(); $this->logger->get('access denied')->warning('Path: @uri. %type: @message in %function (line %line of %file).', $error); $this->logger->get('access denied')->warning('Path: @uri. ' . Error::DEFAULT_ERROR_MESSAGE, $error); } /** Loading @@ -67,7 +67,7 @@ public function on404(ExceptionEvent $event) { public function onError(ExceptionEvent $event) { $exception = $event->getThrowable(); $error = Error::decodeException($exception); $this->logger->get('php')->log($error['severity_level'], '%type: @message in %function (line %line of %file).', $error); $this->logger->get('php')->log($error['severity_level'], Error::DEFAULT_ERROR_MESSAGE, $error); $is_critical = !$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500; if ($is_critical) { Loading