diff --git a/core/lib/Drupal/Core/Template/RenderWrapper.php b/core/lib/Drupal/Core/Template/RenderWrapper.php
index 7d7770d..94af2bf 100644
--- a/core/lib/Drupal/Core/Template/RenderWrapper.php
+++ b/core/lib/Drupal/Core/Template/RenderWrapper.php
@@ -52,7 +52,13 @@ public function __construct($callback, array $args = array()) {
    * Implements the magic __toString() method.
    */
   public function __toString() {
-    return $this->render();
+    try {
+      return $this->render();
+    }
+    catch (\Exception $e) {
+      $trace = $e->getTrace();
+      trigger_error('Unable to re-throw exception. Message: "'.$e->getMessage().'"; Line: '.$trace[0]['line'].'; File: '.$trace[0]['file'], E_USER_ERROR);
+    }
   }
 
   /**
@@ -62,6 +68,7 @@ public function __toString() {
    *   The results of the callback function.
    */
   public function render() {
+    throw new \Exception('This is an exception to demonstrate the problem');
     if (!empty($this->callback) && is_callable($this->callback)) {
       return call_user_func_array($this->callback, $this->args);
     }
