tedious
Version:
A TDS driver, for connecting to MS SQLServer databases.
58 lines (48 loc) • 1.71 kB
JavaScript
// Generated by CoffeeScript 1.7.1
var ConnectionError, RequestError,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
ConnectionError = (function(_super) {
__extends(ConnectionError, _super);
function ConnectionError(message, code) {
var err;
if (!(this instanceof ConnectionError)) {
if (message instanceof ConnectionError) {
return message;
}
err = new ConnectionError(message, code);
Error.captureStackTrace(err, arguments.callee);
return err;
}
this.name = this.constructor.name;
this.message = message;
this.code = code;
ConnectionError.__super__.constructor.call(this);
Error.captureStackTrace(this, this.constructor);
}
return ConnectionError;
})(Error);
RequestError = (function(_super) {
__extends(RequestError, _super);
function RequestError(message, code) {
var err;
if (!(this instanceof RequestError)) {
if (message instanceof RequestError) {
return message;
}
err = new RequestError(message, code);
Error.captureStackTrace(err, arguments.callee);
return err;
}
this.name = this.constructor.name;
this.message = message;
this.code = code;
RequestError.__super__.constructor.call(this);
Error.captureStackTrace(this, this.constructor);
}
return RequestError;
})(Error);
module.exports = {
ConnectionError: ConnectionError,
RequestError: RequestError
};