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

Commit 76e5a15

Browse files
fix($httpBackend): ugly solution for unexpected request fail on verify no outstanding request
1 parent c1ad9ac commit 76e5a15

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/ng/q.js

+4
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {
364364
}
365365
} catch (e) {
366366
rejectPromise(promise, e);
367+
// TODO ugly!
368+
if (e && e.rethrow === true) {
369+
exceptionHandler(e);
370+
}
367371
}
368372
}
369373
} finally {

src/ngMock/angular-mocks.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1438,10 +1438,15 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
14381438
return;
14391439
}
14401440
}
1441-
throw wasExpected ?
1441+
var error = wasExpected ?
14421442
new Error('No response defined !') :
14431443
new Error('Unexpected request: ' + method + ' ' + url + '\n' +
14441444
(expectation ? 'Expected ' + expectation : 'No more request expected'));
1445+
1446+
// TODO ugly!
1447+
error.rethrow = true;
1448+
1449+
throw error;
14451450
}
14461451

14471452
/**

0 commit comments

Comments
 (0)