UNPKG

6.48 kBJavaScriptView Raw
1var __extends = (this && this.__extends) || (function () {
2 var extendStatics = Object.setPrototypeOf ||
3 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5 return function (d, b) {
6 extendStatics(d, b);
7 function __() { this.constructor = d; }
8 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
9 };
10})();
11Object.defineProperty(exports, "__esModule", { value: true });
12var os_1 = require("os");
13var chalk = require("chalk");
14var Exception = (function (_super) {
15 __extends(Exception, _super);
16 function Exception(msg, innerException) {
17 var _this = _super.call(this, innerException ? chalk.red(msg) + " -> " + chalk.red(innerException.stack || '') : chalk.red(msg)) || this;
18 _this.innerException = innerException;
19 return _this;
20 }
21 return Exception;
22}(Error));
23exports.Exception = Exception;
24var AggregateException = (function (_super) {
25 __extends(AggregateException, _super);
26 function AggregateException(exceptions) {
27 var _this = _super.call(this, "Multiple exceptions occurred (" + exceptions.length + ") " + chalk.red("[" + exceptions.map(function (e) { return e.stack; }).join(', ') + "]")) || this;
28 _this.exceptions = exceptions;
29 return _this;
30 }
31 Object.defineProperty(AggregateException.prototype, "stack", {
32 get: function () {
33 return this.exceptions.map(function (e) { return e.stack; }).join(os_1.EOL);
34 },
35 enumerable: true,
36 configurable: true
37 });
38 AggregateException.prototype.toString = function () {
39 return this.exceptions.map(function (e) { return e.toString(); }).join(os_1.EOL);
40 };
41 return AggregateException;
42}(Exception));
43exports.AggregateException = AggregateException;
44var NotImplementedException = (function (_super) {
45 __extends(NotImplementedException, _super);
46 function NotImplementedException() {
47 return _super.call(this, 'Not implemented') || this;
48 }
49 return NotImplementedException;
50}(Exception));
51exports.NotImplementedException = NotImplementedException;
52var NotSupportedException = (function (_super) {
53 __extends(NotSupportedException, _super);
54 function NotSupportedException() {
55 return _super.call(this, 'This operation is not supported in a browserless context and never will be') || this;
56 }
57 return NotSupportedException;
58}(Exception));
59exports.NotSupportedException = NotSupportedException;
60var CompilerException = (function (_super) {
61 __extends(CompilerException, _super);
62 function CompilerException() {
63 return _super !== null && _super.apply(this, arguments) || this;
64 }
65 return CompilerException;
66}(Exception));
67exports.CompilerException = CompilerException;
68var ConfigurationException = (function (_super) {
69 __extends(ConfigurationException, _super);
70 function ConfigurationException() {
71 return _super !== null && _super.apply(this, arguments) || this;
72 }
73 return ConfigurationException;
74}(Exception));
75exports.ConfigurationException = ConfigurationException;
76var FilesystemException = (function (_super) {
77 __extends(FilesystemException, _super);
78 function FilesystemException() {
79 return _super !== null && _super.apply(this, arguments) || this;
80 }
81 return FilesystemException;
82}(Exception));
83exports.FilesystemException = FilesystemException;
84var ModuleException = (function (_super) {
85 __extends(ModuleException, _super);
86 function ModuleException() {
87 return _super !== null && _super.apply(this, arguments) || this;
88 }
89 return ModuleException;
90}(Exception));
91exports.ModuleException = ModuleException;
92var OutputException = (function (_super) {
93 __extends(OutputException, _super);
94 function OutputException() {
95 return _super !== null && _super.apply(this, arguments) || this;
96 }
97 return OutputException;
98}(Exception));
99exports.OutputException = OutputException;
100var PlatformException = (function (_super) {
101 __extends(PlatformException, _super);
102 function PlatformException() {
103 return _super !== null && _super.apply(this, arguments) || this;
104 }
105 return PlatformException;
106}(Exception));
107exports.PlatformException = PlatformException;
108var RendererException = (function (_super) {
109 __extends(RendererException, _super);
110 function RendererException() {
111 return _super !== null && _super.apply(this, arguments) || this;
112 }
113 return RendererException;
114}(Exception));
115exports.RendererException = RendererException;
116var ResourceException = (function (_super) {
117 __extends(ResourceException, _super);
118 function ResourceException() {
119 return _super !== null && _super.apply(this, arguments) || this;
120 }
121 return ResourceException;
122}(Exception));
123exports.ResourceException = ResourceException;
124var RuntimeException = (function (_super) {
125 __extends(RuntimeException, _super);
126 function RuntimeException() {
127 return _super !== null && _super.apply(this, arguments) || this;
128 }
129 return RuntimeException;
130}(Exception));
131exports.RuntimeException = RuntimeException;
132var RouteException = (function (_super) {
133 __extends(RouteException, _super);
134 function RouteException() {
135 return _super !== null && _super.apply(this, arguments) || this;
136 }
137 return RouteException;
138}(Exception));
139exports.RouteException = RouteException;
140var SnapshotException = (function (_super) {
141 __extends(SnapshotException, _super);
142 function SnapshotException() {
143 return _super !== null && _super.apply(this, arguments) || this;
144 }
145 return SnapshotException;
146}(Exception));
147exports.SnapshotException = SnapshotException;
148var StaticAnalysisException = (function (_super) {
149 __extends(StaticAnalysisException, _super);
150 function StaticAnalysisException() {
151 return _super !== null && _super.apply(this, arguments) || this;
152 }
153 return StaticAnalysisException;
154}(Exception));
155exports.StaticAnalysisException = StaticAnalysisException;
156var TranspileException = (function (_super) {
157 __extends(TranspileException, _super);
158 function TranspileException() {
159 return _super !== null && _super.apply(this, arguments) || this;
160 }
161 return TranspileException;
162}(Exception));
163exports.TranspileException = TranspileException;
164//# sourceMappingURL=exception.js.map
\No newline at end of file