Issue 1:
I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

After the default error handler processes the first error it no longer processes any future errors.

Expected behavior

That every error that happens is processed by the error handler.

Minimal reproduction of the problem with instructions

http://plnkr.co/edit/uqY6rcA9gRDtC8nsmoka

This is a simple example that adds a button which calls a function to throw an error.

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.

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.

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.

{code}

private __tryOrUnsub(fn: Function, value?: any): void {

try {

fn.call(this._context, value);

} catch (err) {

this.unsubscribe();

throw err;

}

}

{code}

What is the motivation / use case for changing the behavior?

The error handler should always handle any error.

Please tell us about your environment:

Windows 7 (64 bit), webstorm (2016.3.1), npm / webpack/ angular cli, Spring Boot / Tomcat

Angular version: 2.0.X

2.2.1

Browser: [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 ]

Likely all, chrome 54, firefox 50.0.1 for sure.

Language: [all | TypeScript X.X | ES6/7 | ES5]

TypeScript 2.0.3, targeting ES5

Node (for AoT issues): node --version =

Issue 2:
I'm submitting a ...

bug report

feature request

support request => Please do not submit support request here, see note at the top of this template.

Current behavior

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 ExceptionHandler.

Expected/desired behavior

Every exception thrown should reach ExceptionHandler (and therefore a maybe existing custom exception handler can kick in).

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

http://plnkr.co/edit/4pA92Dbkg5YXLbJ7dmhl?p=preview

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.

It doesn't matter if the consecutive exceptions are thrown from the same component, a child component or an asynchronous thing (like window.setTimeout).

What is the expected behavior?

Every button click should trigger an exception which comes up in the browser's console.

What is the motivation / use case for changing the behavior?

I found this bug while digging into implementing my own exception handler and reporting exceptions to a service like https://exceptionless.com/.

Please tell us about your environment:

My app was created with angular-cli beta 5.

Angular version: 2.0.0-rc1

Browser: all

Language: TypeScript 1.8