abb-core
Version:
Application Build Butler Core
37 lines (36 loc) • 1.24 kB
JavaScript
import * as tslib_1 from "tslib";
import EABBRESTMethods from '../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));
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: EABBRESTMethods.PUT,
preventLogToServer: true
}) || this;
}
return ABBErrorDummy;
}(ABBError));
export { ABBError, ABBErrorDummy };