1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
8 |
|
9 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
10 |
|
11 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | var ExtendableError = function (_Error) {
|
18 | _inherits(ExtendableError, _Error);
|
19 |
|
20 | function ExtendableError(message, status, isPublic) {
|
21 | _classCallCheck(this, ExtendableError);
|
22 |
|
23 | var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message));
|
24 |
|
25 | _this.name = _this.constructor.name;
|
26 | _this.message = message;
|
27 | _this.status = status;
|
28 | _this.isPublic = isPublic;
|
29 | _this.isOperational = true;
|
30 | Error.captureStackTrace(_this, _this.constructor.name);
|
31 | return _this;
|
32 | }
|
33 |
|
34 | return ExtendableError;
|
35 | }(Error);
|
36 |
|
37 | exports.default = ExtendableError;
|
38 | module.exports = exports['default'];
|
39 |
|