This commit is contained in:
David Humphrey (:humph) david.humphrey@senecacollege.ca 2014-07-24 12:24:47 -04:00
parent 79e9008175
commit 9d704e80c9
1 changed files with 7 additions and 6 deletions

View File

@ -77,16 +77,17 @@ var errors = {};
err = e[1],
message = e[2];
function ctor(m) {
function FilerError(m) {
this.name = err;
this.code = err;
this.errno = errno;
this.message = m || message;
}
var proto = ctor.prototype = new Error();
proto.errno = errno;
proto.code = err;
proto.constructor = ctor;
FilerError.prototype = Object.create(Error.prototype);
FilerError.prototype.constructor = FilerError;
// We expose the error as both Errors.EINVAL and Errors[18]
errors[err] = errors[errno] = ctor;
errors[err] = errors[errno] = FilerError;
});
module.exports = errors;