<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><br>
After the default error handler processes the first error it no longer processes any future errors.</p>
<p dir="auto"><strong>Expected behavior</strong><br>
That every error that happens is processed by the error handler.</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br>
<a href="http://plnkr.co/edit/uqY6rcA9gRDtC8nsmoka" rel="nofollow">http://plnkr.co/edit/uqY6rcA9gRDtC8nsmoka</a><br>
This is a simple example that adds a button which calls a function to throw an error.<br>
The first time the button is click the error is logged to the console.  Any further clicks of the button throw the error but the error handler does not capture the error and handle it.</p>
<p dir="auto">You can see this error with the plnkr example by clicking the throw error button and watching the console log.  The first occurrence logs and any future occurrences of the error being thrown don't go through the errorhandler.</p>
<p dir="auto">If the error handler is constructor to not rethrow the error it works as expected.  It appears that when the error is rethrown this gets an error in the Subscriber.ts line 236-241.  My theory is this unsubscribes the error handler which is why no future errors are processed by the error handler.</p>
<p dir="auto">{code}<br>
private __tryOrUnsub(fn: Function, value?: any): void {<br>
try {<br>
fn.call(this._context, value);<br>
} catch (err) {<br>
this.unsubscribe();<br>
throw err;<br>
}<br>
}<br>
{code}</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
The error handler should always handle any error.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>

<p dir="auto">Windows 7 (64 bit), webstorm (2016.3.1), npm / webpack/ angular cli, Spring Boot / Tomcat</p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Angular version:</strong> 2.0.X<br>
2.2.1</p>
</li>
<li>
<p dir="auto"><strong>Browser:</strong> [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]<br>
Likely all, chrome 54, firefox 50.0.1 for sure.</p>
</li>
<li>
<p dir="auto"><strong>Language:</strong> [all | TypeScript X.X | ES6/7 | ES5]<br>
TypeScript 2.0.3, targeting ES5</p>
</li>
<li>
<p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> =</p>
</li>
</ul>
<ul class="contains-task-list">
<li><strong>I'm submitting a ...</strong></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> bug report</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> feature request</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> support request =&gt; Please do not submit support request here, see note at the top of this template.</li>
</ul>
<p dir="auto"><strong>Current behavior</strong><br>
An exception is thrown and gets printed in the browser's console. If there are other exceptions thrown afterwards, they don't come up in the browser's console and never reach <code class="notranslate">ExceptionHandler</code>.</p>
<p dir="auto"><strong>Expected/desired behavior</strong><br>
Every exception thrown should reach <code class="notranslate">ExceptionHandler</code> (and therefore a maybe existing custom exception handler can kick in).</p>
<ul dir="auto">
<li><strong>If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem</strong><br>
<a href="http://plnkr.co/edit/4pA92Dbkg5YXLbJ7dmhl?p=preview" rel="nofollow">http://plnkr.co/edit/4pA92Dbkg5YXLbJ7dmhl?p=preview</a><br>
Click on any of the two buttons and you will see an exception in the browser's console. Do another button click and you will see that the click handler is called, but the exception isn't printed in the console.<br>
It doesn't matter if the consecutive exceptions are thrown from the same component, a child component or an asynchronous thing (like <code class="notranslate">window.setTimeout</code>).</li>
<li><strong>What is the expected behavior?</strong><br>
Every button click should trigger an exception which comes up in the browser's console.</li>
<li><strong>What is the motivation / use case for changing the behavior?</strong><br>
I found this bug while digging into implementing my own exception handler and reporting exceptions to a service like <a href="Exceptionless">https://exceptionless.com/</a>.</li>
<li><strong>Please tell us about your environment:</strong><br>
My app was created with angular-cli beta 5.</li>
<li><strong>Angular version:</strong> 2.0.0-rc1</li>
<li><strong>Browser:</strong> all</li>
<li><strong>Language:</strong> TypeScript 1.8</li>
</ul>