<p dir="auto"><strong>I'm submitting a ...</strong>  (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ X] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[ X] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong></p>
<p dir="auto">An error inside a template is swallowed if the template was rendered as a response to a promise resolution.</p>
<p dir="auto">In other cases the same exception is properly logged. Exception in .then() is OK. Exception in template that was not rendered in response to a promise is OK</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">The exception should either be passed to the .catch-function or logged.</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong></p>
<p dir="auto"><a href="http://plnkr.co/edit/ilqlcUUnrRpvFEFuzQc6?p=preview&amp;open=app%2Fapp.component.ts" rel="nofollow">http://plnkr.co/edit/ilqlcUUnrRpvFEFuzQc6?p=preview&amp;open=app%2Fapp.component.ts</a></p>
<p dir="auto">Run the plunkr and see that there is no exeption.</p>
<p dir="auto">Comment out Mark2 and put back in Mark1 or Mark3 and see that the error is handled properly.</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p>
<p dir="auto">When the error inside templates silently fails It makes it much harder for me to figure out why the template does not finish rendering.</p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Angular version:</strong> 4.0.0</p>
</li>
<li>
<p dir="auto"><strong>Browser:</strong> Chrome, bot probably all.</p>
</li>
</ul>
<p dir="auto">zone.js seems to have managed to eaten an exception that I needed. Don't know if this is actually zone.js's fault or something further down the stack is suppose to handle notifying of the exception but I figured you could probably tell me. Stack trace of exception follows</p>
<p dir="auto">(anonymous) (display.component.ngfactory.ts:486)<br>
debugUpdateRenderer (core.es5.js:12651)<br>
checkAndUpdateView (core.es5.js:12030)<br>
callViewAction (core.es5.js:12340)<br>
execComponentViewsAction (core.es5.js:12286)<br>
checkAndUpdateView (core.es5.js:12031)<br>
callViewAction (core.es5.js:12340)<br>
execEmbeddedViewsAction (core.es5.js:12312)<br>
checkAndUpdateView (core.es5.js:12026)<br>
callViewAction (core.es5.js:12340)<br>
execEmbeddedViewsAction (core.es5.js:12312)<br>
checkAndUpdateView (core.es5.js:12026)<br>
callViewAction (core.es5.js:12340)<br>
execComponentViewsAction (core.es5.js:12286)<br>
checkAndUpdateView (core.es5.js:12031)<br>
callViewAction (core.es5.js:12340)<br>
execEmbeddedViewsAction (core.es5.js:12312)<br>
checkAndUpdateView (core.es5.js:12026)<br>
callViewAction (core.es5.js:12340)<br>
execEmbeddedViewsAction (core.es5.js:12312)<br>
checkAndUpdateView (core.es5.js:12026)<br>
callViewAction (core.es5.js:12340)<br>
execComponentViewsAction (core.es5.js:12286)<br>
checkAndUpdateView (core.es5.js:12031)<br>
callViewAction (core.es5.js:12340)<br>
execEmbeddedViewsAction (core.es5.js:12312)<br>
checkAndUpdateView (core.es5.js:12026)<br>
callViewAction (core.es5.js:12340)<br>
execComponentViewsAction (core.es5.js:12286)<br>
checkAndUpdateView (core.es5.js:12031)<br>
callWithDebugContext (core.es5.js:13013)<br>
debugCheckAndUpdateView (core.es5.js:12553)<br>
ViewRef_.detectChanges (core.es5.js:10122)<br>
(anonymous) (core.es5.js:5052)<br>
ApplicationRef_.tick (core.es5.js:5052)<br>
(anonymous) (core.es5.js:4932)<br>
ZoneDelegate.invoke (zone.js:365)<br>
onInvoke (core.es5.js:4125)<br>
ZoneDelegate.invoke (zone.js:364)<br>
Zone.run (zone.js:125)<br>
NgZone.run (core.es5.js:3994)<br>
next (core.es5.js:4932)<br>
schedulerFn (core.es5.js:3828)<br>
SafeSubscriber.__tryOrUnsub (Subscriber.js:234)<br>
SafeSubscriber.next (Subscriber.js:183)<br>
Subscriber._next (Subscriber.js:125)<br>
Subscriber.next (Subscriber.js:89)<br>
Subject.next (Subject.js:55)<br>
EventEmitter.emit (core.es5.js:3814)<br>
NgZone.checkStable (core.es5.js:4090)<br>
NgZone.setHasMicrotask (core.es5.js:4174)<br>
onHasTask (core.es5.js:4137)<br>
ZoneDelegate.hasTask (zone.js:418) //caught here<br>
ZoneDelegate._updateTaskCount (zone.js:438)<br>
Zone._updateTaskCount (zone.js:262)<br>
Zone.runTask (zone.js:182)<br>
drainMicroTaskQueue (zone.js:593)<br>
ZoneTask.invoke (zone.js:464)</p>
<p dir="auto">edit: (attempted) clarification<br>
An exception's information is lost, specifically here's what happened.</p>
<ol dir="auto">
<li>an angular template references invalid_variable.foo</li>
<li>this throws an error ReferenceError: invalid_variable is not defined or possibly Cannot read property 'foo' of undefined (the exact error isn't important)</li>
<li>the exception propagates up the stack (it's an exception after all) At several points it's caught enhanced with more information and thrown again, no surprises there.</li>
<li>ZoneDelegate.hasTask (zone.js:418) is wraped in a try catch where the catch does nothing. This catches the exception and stops handling it<br>
result: angular template stops rendering and it's very difficult to debug, as no stack trace or other error information are logged to the console. The error is currently silently caught and discarded.</li>
</ol>
<p dir="auto">desired behavior<br>
The exception is at some point shown to me either by being logged at some point, or being thrown and not caught at some point.</p>