Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

$q always calls $exceptionHandler on throw, even if the exception is handled #10683

Closed
bluepnume opened this issue Jan 8, 2015 · 1 comment
Closed

Comments

@bluepnume
Copy link
Contributor

Please see the following:

https://github.com/angular/angular.js/blob/master/src/ng/q.js#L323

This means the exception in the following code will be handled in two different places, assuming I have defined an $exceptionHandler:

                    $q.when().then(function() {
                        throw new Error('doowop');
                    }).catch(function(err) {
                        console.log(err.toString());
                    });

This makes it very difficult to catch errors in the correct places, and not have the global exception hander kick in...

@pkozlowski-opensource
Copy link
Member

@bluepnume yeh, this is unfortunate, we are aware of the thing, there is a duplicate issue: #7992
I'm going to close this one as a duplicate, let's centralise the discussion in #7992

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants