Skip to content

Commit 97fc248

Browse files
committed
cleanup(di): changed an error message to be more descriptive
1 parent 7bd682b commit 97fc248

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

modules/angular2/src/di/exceptions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ export class NoAnnotationError extends Error {
106106
message:string;
107107
constructor(typeOrFunc) {
108108
super();
109-
this.message = `Cannot resolve all parameters for ${stringify(typeOrFunc)}`;
109+
this.message = `Cannot resolve all parameters for ${stringify(typeOrFunc)}.` +
110+
` Make sure they all have valid type or annotations.`;
110111
}
111112

112113
toString() {

modules/angular2/test/di/injector_spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ export function main() {
100100

101101
it('should throw when no type and not @Inject', function () {
102102
expect(() => Injector.resolveAndCreate([NoAnnotations])).toThrowError(
103-
'Cannot resolve all parameters for NoAnnotations');
103+
'Cannot resolve all parameters for NoAnnotations. '+
104+
'Make sure they all have valid type or annotations.');
104105
});
105106

106107
it('should cache instances', function () {

0 commit comments

Comments
 (0)