Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function ConnectionClosedError(msg) {
WError.call(this, msg || 'the underlying connection has been closed');
}
util.inherits(ConnectionClosedError, WError);
function ChecksumError(exp, actual, msg) {
WError.call(this, {}, 'checksum error(%d): caclulated %d', exp, actual);
this.context = {
expected_crc: exp,
actual_crc: actual,
message: msg
};
this.name = this.constructor.name;
}
util.inherits(ChecksumError, WError);
function NoConnectionError() {
WError.call(this, 'no connection');
}
util.inherits(NoConnectionError, WError);
function DNSError(err, host) {
WError.call(this, err, host + ' could not be found in DNS');
}
util.inherits(DNSError, WError);
function InvalidContentError(cause, msg) {
WError.call(this, cause, 'invalid JSON encountered');
this.context = {
message: msg
};
this.name = this.constructor.name;
}
util.inherits(InvalidContentError, WError);
function UnsolicitedMessageError(message) {
WError.call(this, 'unsolicited message');
this.msg = message;
}
util.inherits(UnsolicitedMessageError, WError);
function ConnectionTimeoutError(time) {
WError.call(this, 'failed to establish connection after %dms', time);
}
util.inherits(ConnectionTimeoutError, WError);