fix(di): capture original exception in InvalidBindingError
Fixes #1406 Closes #1459
This commit is contained in:
8
modules/angular2/src/di/exceptions.js
vendored
8
modules/angular2/src/di/exceptions.js
vendored
@ -140,13 +140,17 @@ export class CyclicDependencyError extends AbstractBindingError {
|
||||
* @exportedAs angular2/di_errors
|
||||
*/
|
||||
export class InstantiationError extends AbstractBindingError {
|
||||
cause;
|
||||
causeKey;
|
||||
// TODO(tbosch): Can't do key:Key as this results in a circular dependency!
|
||||
constructor(originalException, key) {
|
||||
constructor(cause, key) {
|
||||
super(key, function (keys:List) {
|
||||
var first = stringify(ListWrapper.first(keys).token);
|
||||
return `Error during instantiation of ${first}!${constructResolvingPath(keys)}.` +
|
||||
` ORIGINAL ERROR: ${originalException}`;
|
||||
` ORIGINAL ERROR: ${cause}`;
|
||||
});
|
||||
this.cause = cause;
|
||||
this.causeKey = key;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user