aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/q.js
diff options
context:
space:
mode:
authorPete Bacon Darwin2013-07-31 10:09:23 +0100
committerPete Bacon Darwin2013-07-31 21:17:38 +0100
commit664526d69c927370c93a06745ca38de7cd03a7be (patch)
treecba5fe7694f91fad72ade0a8490e6fd1b6300482 /src/ng/q.js
parenta644ca7b4e6ba84a467bcabed8f99386eda7fb14 (diff)
downloadangular.js-664526d69c927370c93a06745ca38de7cd03a7be.tar.bz2
fix($q): call `reject()` even if `$exceptionHandler` rethrows
Normally $exceptionHandler doesn't throw an exception. It is normally used just for logging and so on. But if an application developer implemented a version that did throw an exception then $q would never have called reject() when converting an exception thrown inside a `then` handler into a rejected promise.
Diffstat (limited to 'src/ng/q.js')
-rw-r--r--src/ng/q.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ng/q.js b/src/ng/q.js
index fe05b37f..b68660d5 100644
--- a/src/ng/q.js
+++ b/src/ng/q.js
@@ -237,8 +237,8 @@ function qFactory(nextTick, exceptionHandler) {
try {
result.resolve((callback || defaultCallback)(value));
} catch(e) {
- exceptionHandler(e);
result.reject(e);
+ exceptionHandler(e);
}
};
@@ -246,8 +246,8 @@ function qFactory(nextTick, exceptionHandler) {
try {
result.resolve((errback || defaultErrback)(reason));
} catch(e) {
- exceptionHandler(e);
result.reject(e);
+ exceptionHandler(e);
}
};