@@ -36,8 +36,8 @@ export class AbstractBindingError extends BaseException {
3636 keys : List < any > ;
3737 constructResolvingMessage : Function ;
3838 // TODO(tbosch): Can't do key:Key as this results in a circular dependency!
39- constructor ( key , constructResolvingMessage : Function ) {
40- super ( ) ;
39+ constructor ( key , constructResolvingMessage : Function , originalException ? , originalStack ? ) {
40+ super ( null , originalException , originalStack ) ;
4141 this . keys = [ key ] ;
4242 this . constructResolvingMessage = constructResolvingMessage ;
4343 this . message = this . constructResolvingMessage ( this . keys ) ;
@@ -138,19 +138,18 @@ export class CyclicDependencyError extends AbstractBindingError {
138138 * @exportedAs angular2/di_errors
139139 */
140140export class InstantiationError extends AbstractBindingError {
141- cause ;
142141 causeKey ;
143- stack ;
144142
145143 // TODO(tbosch): Can't do key:Key as this results in a circular dependency!
146- constructor ( cause , stack , key ) {
144+ constructor ( originalException , originalStack , key ) {
147145 super ( key , function ( keys : List < any > ) {
148146 var first = stringify ( ListWrapper . first ( keys ) . token ) ;
149- return `Error during instantiation of ${ first } !${ constructResolvingPath ( keys ) } . ORIGINAL ERROR: ${ cause } ` ;
150- } ) ;
151- this . cause = cause ;
147+ return `Error during instantiation of ${ first } !${ constructResolvingPath ( keys ) } .` +
148+ ` ORIGINAL ERROR: ${ originalException } ` +
149+ `\n\n ORIGINAL STACK: ${ originalStack } ` ;
150+ } , originalException , originalStack ) ;
151+
152152 this . causeKey = key ;
153- this . stack = stack ;
154153 }
155154}
156155
0 commit comments