From 97fc248e008034a119ea5b330faec26d9d43434a Mon Sep 17 00:00:00 2001 From: vsavkin Date: Mon, 13 Apr 2015 10:05:11 -0700 Subject: [PATCH] cleanup(di): changed an error message to be more descriptive --- modules/angular2/src/di/exceptions.js | 3 ++- modules/angular2/test/di/injector_spec.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/angular2/src/di/exceptions.js b/modules/angular2/src/di/exceptions.js index 2bdb8ebfd8..c436d9f1e8 100644 --- a/modules/angular2/src/di/exceptions.js +++ b/modules/angular2/src/di/exceptions.js @@ -106,7 +106,8 @@ export class NoAnnotationError extends Error { message:string; constructor(typeOrFunc) { super(); - this.message = `Cannot resolve all parameters for ${stringify(typeOrFunc)}`; + this.message = `Cannot resolve all parameters for ${stringify(typeOrFunc)}.` + + ` Make sure they all have valid type or annotations.`; } toString() { diff --git a/modules/angular2/test/di/injector_spec.js b/modules/angular2/test/di/injector_spec.js index 508519d148..b31e72a171 100644 --- a/modules/angular2/test/di/injector_spec.js +++ b/modules/angular2/test/di/injector_spec.js @@ -100,7 +100,8 @@ export function main() { it('should throw when no type and not @Inject', function () { expect(() => Injector.resolveAndCreate([NoAnnotations])).toThrowError( - 'Cannot resolve all parameters for NoAnnotations'); + 'Cannot resolve all parameters for NoAnnotations. '+ + 'Make sure they all have valid type or annotations.'); }); it('should cache instances', function () {