InstantiationError

export class InstantiationError

exported from angular2/core defined in angular2/src/core/di/exceptions.ts (line 109)

Thrown when a constructing type returns with an Error.

The InstantiationError class contains the original error plus the dependency graph which caused this object to be instantiated.

Example (live demo)

class A { constructor() { throw new Error('message'); } } var injector = Injector.resolveAndCreate([A]); try { injector.get(A); } catch (e) { expect(e instanceof InstantiationError).toBe(true); expect(e.originalException.message).toEqual("message"); expect(e.originalStack).toBeDefined(); }

Constructor

constructor(injector: Injector, originalException: any, originalStack: any, key: Key)

Not Yet Documented

Members

addKey(injector: Injector, key: Key) : void

Not Yet Documented

wrapperMessage : string

Not Yet Documented

causeKey : Key

Not Yet Documented

context

Not Yet Documented