dart-archive / di.dart

DEPRECATED
https://webdev.dartlang.org/angular/guide/dependency-injection
MIT License
66 stars 57 forks source link

Better error message when dynamic injector can't find the default constructor #45

Closed pavelgj closed 10 years ago

pavelgj commented 10 years ago

Right now an error like this is produces when default constructor for an injectable type is not found by DynamicInjector.

Uncaught TypeError: Cannot call method 'get$parameters' of undefined dynamic_injector.dart:42
DynamicInjector.newInstanceOf$4 dynamic_injector.dart:42
_TypeProvider.get$4 module.dart:142
Injector__getInstanceByType_closure.call$0 injector.dart:118
_defaultCreationStrategy module.dart:106
Injector._getInstanceByType$2 injector.dart:116
(anonymous function) VM7762:3
DynamicInjector_newInstanceOf_resolveArgument.call$1 dynamic_injector.dart:39
List_List$generate list.dart:127
DynamicInjector.newInstanceOf$4 dynamic_injector.dart:42
_TypeProvider.get$4 module.dart:142
Injector__getInstanceByType_closure.call$0 injector.dart:118
...
pavelgj commented 10 years ago

Fixed in https://github.com/angular/di.dart/commit/91c35c01a3ae0c4c0188fde156fe24c9a322933c