aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIgor Minar2013-08-21 22:57:48 -0700
committerIgor Minar2013-08-24 12:49:46 -0700
commit5d9f42050a11015adbd5dc4dde73818919e93a99 (patch)
tree0d9096b863ff8add148e8ad180816b1937c28ad3 /src
parent80d0f98263786ef302ca7551c4515560a7c07195 (diff)
downloadangular.js-5d9f42050a11015adbd5dc4dde73818919e93a99.tar.bz2
fix($q): reject should catch & forward exceptions thrown in errback
Diffstat (limited to 'src')
-rw-r--r--src/ng/q.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ng/q.js b/src/ng/q.js
index cc39967c..6c4d3f5f 100644
--- a/src/ng/q.js
+++ b/src/ng/q.js
@@ -375,7 +375,12 @@ function qFactory(nextTick, exceptionHandler) {
then: function(callback, errback) {
var result = defer();
nextTick(function() {
- result.resolve((isFunction(errback) ? errback : defaultErrback)(reason));
+ try {
+ result.resolve((isFunction(errback) ? errback : defaultErrback)(reason));
+ } catch(e) {
+ result.reject(e);
+ exceptionHandler(e);
+ }
});
return result.promise;
}