refactor(exception_handler): unified all exception handling
BREAKING CHANGE Previously it was possible to pass a custom error reporter to bootstrap, which was used only during the construction of Injector. This had limited utility, so this capability has been removed.
This commit is contained in:
@ -83,8 +83,7 @@ export function main() {
|
||||
|
||||
it('should throw if bootstrapped Directive is not a Component',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
var refPromise =
|
||||
bootstrap(HelloRootDirectiveIsNotCmp, testBindings, (e, t) => { throw e; });
|
||||
var refPromise = bootstrap(HelloRootDirectiveIsNotCmp, testBindings);
|
||||
|
||||
PromiseWrapper.then(refPromise, null, (reason) => {
|
||||
expect(reason.message)
|
||||
@ -96,7 +95,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it('should throw if no element is found', inject([AsyncTestCompleter], (async) => {
|
||||
var refPromise = bootstrap(HelloRootCmp, [], (e, t) => { throw e; });
|
||||
var refPromise = bootstrap(HelloRootCmp, []);
|
||||
PromiseWrapper.then(refPromise, null, (reason) => {
|
||||
expect(reason.message).toContain('The selector "hello-app" did not match any elements');
|
||||
async.done();
|
||||
|
@ -21,7 +21,7 @@ export function main() {
|
||||
describe("LifeCycle", () => {
|
||||
it("should throw when reentering tick", () => {
|
||||
var cd = <any>new SpyChangeDetector();
|
||||
var lc = new LifeCycle(null, cd, false);
|
||||
var lc = new LifeCycle(cd, false);
|
||||
|
||||
cd.spy("detectChanges").andCallFake(() => lc.tick());
|
||||
expect(() => lc.tick()).toThrowError("LifeCycle.tick is called recursively");
|
||||
|
Reference in New Issue
Block a user