diff --git a/core/lib/Drupal/Component/Datetime/DateTimePlus.php b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
index c3edf99..c38ec66 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 ' . get_class($this) . ' object in ' . $e->getFile() . ' on line ' . $e->getLine() . ': ' . $e->getMessage(), E_USER_NOTICE);
+      return '';
+    }
   }
 
   /**
diff --git a/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php
index dffd2cf..ea325a3 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 ' . get_class($this) . ' object in ' . $e->getFile() . ' on line ' . $e->getLine() . ': ' . $e->getMessage(), E_USER_NOTICE);
+      return '';
+    }
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php b/core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php
new file mode 100644
index 0000000..8f99198
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\Tests\Core\StringTranslation\TranslationWrapperTest.
+ */
+
+namespace Drupal\Tests\Core\StringTranslation;
+
+use Drupal\Tests\UnitTestCase;
+use Drupal\Core\StringTranslation\TranslationWrapper;
+
+/**
+ * Tests the TranslationWrapper class.
+ *
+ * @coversDefaultClass \Drupal\Core\StringTranslation\TranslationWrapper
+ * @group StringTranslation
+ */
+class TranslationWrapperTest extends UnitTestCase {
+
+  /**
+   * The error message of the last error in the error handler.
+   *
+   * @var string
+   */
+  protected $lastErrorMessage;
+
+  /**
+   * The error number of the last error in the error handler.
+   *
+   * @var int
+   */
+  protected $lastErrorNumber;
+
+  /**
+   * Custom error handler that saves the last error.
+   *
+   * @param $error_number
+   *   The error number.
+   * @param $error_message
+   *   The error message.
+   */
+  public function errorHandler($error_number, $error_message) {
+    $this->lastErrorNumber = $error_number;
+    $this->lastErrorMessage = $error_message;
+  }
+
+  /**
+   * Tests that errors are correctly handled when a __toString() fails.
+   *
+   * @covers ::__toString
+   */
+  public function testToString() {
+    $text = new TranslationWrapper('May I have an exception please?');
+
+    $translation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
+    $translation->expects($this->any())
+      ->method('translate')
+      ->willReturnCallback(function () {
+        throw new \Exception('Yes you may.');
+      });
+    $text->setStringTranslation($translation);
+
+    set_error_handler(array($this, "errorHandler"));
+    // We want this to trigger an error.
+    $result = (string) $text;
+    restore_error_handler();
+
+    $this->assertEquals(E_USER_NOTICE, $this->lastErrorNumber);
+    $this->assertRegExp('/An exception was thrown while calling __toString on a .*\TranslationWrapper object in .* on line [0-9]+: Yes you may./', $this->lastErrorMessage);
+    $this->assertSame('', $result);
+  }
+
+}
