cleanup(di): changed an error message to be more descriptive
This commit is contained in:
parent
7bd682bb27
commit
97fc248e00
|
@ -106,7 +106,8 @@ export class NoAnnotationError extends Error {
|
||||||
message:string;
|
message:string;
|
||||||
constructor(typeOrFunc) {
|
constructor(typeOrFunc) {
|
||||||
super();
|
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() {
|
toString() {
|
||||||
|
|
|
@ -100,7 +100,8 @@ export function main() {
|
||||||
|
|
||||||
it('should throw when no type and not @Inject', function () {
|
it('should throw when no type and not @Inject', function () {
|
||||||
expect(() => Injector.resolveAndCreate([NoAnnotations])).toThrowError(
|
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 () {
|
it('should cache instances', function () {
|
||||||
|
|
Loading…
Reference in New Issue