diff --git a/core/lib/Drupal/Component/Datetime/DateTimePlus.php b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
index c3edf99..4e1467b 100644
--- a/core/lib/Drupal/Component/Datetime/DateTimePlus.php
+++ b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
@@ -280,7 +280,13 @@ public function __construct($time = 'now', $timezone = NULL, $settings = array()
    */
   public function __toString() {
     $format = static::FORMAT;
-    return $this->format($format) . ' ' . $this->getTimeZone()->getName();
+    try {
+      return $this->format($format) . ' ' . $this->getTimeZone()->getName();
+    }
+    catch (\Exception $e) {
+      trigger_error('An exception was thrown while calling __toString on a ' . gettype($this) . ' in ' . $e->getFile() . ' on line ' . $e->getLine() . ': ' . $e->getMessage());
+      return '';
+    }
   }
 
   /**
diff --git a/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php
index dffd2cf..e3a6108 100644
--- a/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php
+++ b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php
@@ -98,7 +98,13 @@ public function getOptions() {
    * Implements the magic __toString() method.
    */
   public function __toString() {
-    return $this->render();
+    try {
+      return (string) $this->render();
+    }
+    catch (\Exception $e) {
+      trigger_error('An exception was thrown while calling __toString on a ' . gettype($this) . ' in ' . $e->getFile() . ' on line ' . $e->getLine() . ': ' . $e->getMessage());
+      return '';
+    }
   }
 
   /**
