abb-core
Version:
Application Build Butler Core
40 lines (39 loc) • 1.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var EABB_rest_methods_1 = require("../abb-basic/EABB-rest-methods");
var ABBError = /** @class */ (function (_super) {
tslib_1.__extends(ABBError, _super);
function ABBError(props) {
var _this = _super.call(this, props.message) || this;
_this.props = props;
if (!_this.props.preventLogToServer) {
fetch(_this.props.backendURL + '/log/add', {
body: JSON.stringify({
data: _this.props.data,
message: _this.message,
trace: _this.stack,
code: _this.props.code
}),
method: _this.props.createDataMethod,
});
}
return _this;
}
return ABBError;
}(Error));
exports.ABBError = ABBError;
var ABBErrorDummy = /** @class */ (function (_super) {
tslib_1.__extends(ABBErrorDummy, _super);
function ABBErrorDummy() {
return _super.call(this, {
message: 'Error Dummy',
code: 'C-Error-01',
backendURL: '',
createDataMethod: EABB_rest_methods_1.default.PUT,
preventLogToServer: true
}) || this;
}
return ABBErrorDummy;
}(ABBError));
exports.ABBErrorDummy = ABBErrorDummy;