simple-modbus
Version:
A simple library for working with Modbus with Typescript bindings.
52 lines • 2.05 kB
JavaScript
;
// export class ModbusServerError extends Error {
//
// // Impossible to get Jest to see super branch as covered, have to ignore whole constructor
// /* istanbul ignore next */
// constructor(public message: string) {
// super(message)
// this.name = 'ModbusServerError'
// this.message = message
// this.stack = (new Error()).stack
// Object.setPrototypeOf(this, ModbusServerError.prototype)
// }
//
// toString() {
// return this.name + ': ' + this.message
// }
// }
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var ModbusCommandError = /** @class */ (function (_super) {
__extends(ModbusCommandError, _super);
// Impossible to get Jest to see super branch as covered, have to ignore whole constructor
/* istanbul ignore next */
function ModbusCommandError(message, requestBytes) {
var _this = _super.call(this, message) || this;
_this.message = message;
_this.name = 'ModbusCommandError';
_this.message = message;
_this.stack = (new Error()).stack;
_this.requestBytes = requestBytes;
Object.setPrototypeOf(_this, ModbusCommandError.prototype);
return _this;
}
ModbusCommandError.prototype.toString = function () {
return this.name + ': ' + this.message;
};
return ModbusCommandError;
}(Error));
exports.ModbusCommandError = ModbusCommandError;
//# sourceMappingURL=modbus-errors.js.map