1 | "use strict";
|
2 | var __extends = (this && this.__extends) || function (d, b) {
|
3 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
4 | function __() { this.constructor = d; }
|
5 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
6 | };
|
7 | var base_wrapped_exception_1 = require('./base_wrapped_exception');
|
8 | var exception_handler_1 = require('./exception_handler');
|
9 | var exception_handler_2 = require('./exception_handler');
|
10 | exports.ExceptionHandler = exception_handler_2.ExceptionHandler;
|
11 |
|
12 |
|
13 |
|
14 | var BaseException = (function (_super) {
|
15 | __extends(BaseException, _super);
|
16 | function BaseException(message) {
|
17 | if (message === void 0) { message = '--'; }
|
18 | _super.call(this, message);
|
19 | this.message = message;
|
20 | this.stack = (new Error(message)).stack;
|
21 | }
|
22 | BaseException.prototype.toString = function () { return this.message; };
|
23 | return BaseException;
|
24 | }(Error));
|
25 | exports.BaseException = BaseException;
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | var WrappedException = (function (_super) {
|
31 | __extends(WrappedException, _super);
|
32 | function WrappedException(_wrapperMessage, _originalException /** TODO #9100 */, _originalStack /** TODO #9100 */, _context /** TODO #9100 */) {
|
33 | _super.call(this, _wrapperMessage);
|
34 | this._wrapperMessage = _wrapperMessage;
|
35 | this._originalException = _originalException;
|
36 | this._originalStack = _originalStack;
|
37 | this._context = _context;
|
38 | this._wrapperStack = (new Error(_wrapperMessage)).stack;
|
39 | }
|
40 | Object.defineProperty(WrappedException.prototype, "wrapperMessage", {
|
41 | get: function () { return this._wrapperMessage; },
|
42 | enumerable: true,
|
43 | configurable: true
|
44 | });
|
45 | Object.defineProperty(WrappedException.prototype, "wrapperStack", {
|
46 | get: function () { return this._wrapperStack; },
|
47 | enumerable: true,
|
48 | configurable: true
|
49 | });
|
50 | Object.defineProperty(WrappedException.prototype, "originalException", {
|
51 | get: function () { return this._originalException; },
|
52 | enumerable: true,
|
53 | configurable: true
|
54 | });
|
55 | Object.defineProperty(WrappedException.prototype, "originalStack", {
|
56 | get: function () { return this._originalStack; },
|
57 | enumerable: true,
|
58 | configurable: true
|
59 | });
|
60 | Object.defineProperty(WrappedException.prototype, "context", {
|
61 | get: function () { return this._context; },
|
62 | enumerable: true,
|
63 | configurable: true
|
64 | });
|
65 | Object.defineProperty(WrappedException.prototype, "message", {
|
66 | get: function () { return exception_handler_1.ExceptionHandler.exceptionToString(this); },
|
67 | enumerable: true,
|
68 | configurable: true
|
69 | });
|
70 | WrappedException.prototype.toString = function () { return this.message; };
|
71 | return WrappedException;
|
72 | }(base_wrapped_exception_1.BaseWrappedException));
|
73 | exports.WrappedException = WrappedException;
|
74 | function makeTypeError(message) {
|
75 | return new TypeError(message);
|
76 | }
|
77 | exports.makeTypeError = makeTypeError;
|
78 | function unimplemented() {
|
79 | throw new BaseException('unimplemented');
|
80 | }
|
81 | exports.unimplemented = unimplemented;
|
82 |
|
\ | No newline at end of file |