Add stacks

This commit is contained in:
David Humphrey (:humph) david.humphrey@senecacollege.ca 2014-08-18 21:04:09 -04:00
parent 851d863652
commit 29f50ac2fd
1 changed files with 3 additions and 0 deletions

View File

@ -78,6 +78,8 @@ var errors = {};
var defaultMessage = e[2]; var defaultMessage = e[2];
function FilerError(msg, path) { function FilerError(msg, path) {
Error.call(this);
this.name = errName; this.name = errName;
this.code = errName; this.code = errName;
this.errno = errno; this.errno = errno;
@ -85,6 +87,7 @@ var errors = {};
if(path) { if(path) {
this.path = path; this.path = path;
} }
this.stack = (new Error(this.message)).stack;
} }
FilerError.prototype = Object.create(Error.prototype); FilerError.prototype = Object.create(Error.prototype);
FilerError.prototype.constructor = FilerError; FilerError.prototype.constructor = FilerError;