comparison src/implab/di/ActivationError.js @ 0:fc2517695ee1

Initial commit, draft import of existing work
author cin
date Thu, 01 Jun 2017 13:20:03 +0300
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:fc2517695ee1
1 define([
2 "../declare"
3 ], function (declare) {
4 return declare(null, {
5 activationStack: null,
6
7 service: null,
8
9 innerException: null,
10
11 message: null,
12
13 constructor: function (service, activationStack, innerException) {
14 this.message = "Failed to activate the service";
15 this.activationStack = activationStack;
16 this.service = service;
17 this.innerException = innerException;
18 },
19
20 toString: function () {
21 var parts = [this.message];
22 if (this.service)
23 parts.push("when activating: " + this.service.toString());
24
25 if (this.innerException)
26 parts.push("caused by: " + this.innerException.toString());
27
28 if (this.activationStack) {
29 parts.push("at");
30 this.activationStack.forEach(function (x) {
31 parts.push(" " + x.name + " " +
32 (x.service ? x.service.toString() : ""));
33 });
34 }
35
36 return parts.join("\n");
37 }
38 });
39 });