diff --git a/lib/errors.js b/lib/errors.js index 86f5e33..c26e547 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -7,11 +7,12 @@ // - **error_description** (`String`) - the error description // var FigoError = function(error, error_description, errno) { + Error.captureStackTrace(this, FigoError); + this.name = 'FigoError'; this.error = error; - this.error_description = error_description; + this.message = this.error_description = error_description; this.errno = errno; - this.stack = (new Error()).stack; }; FigoError.prototype = Object.create(Error.prototype); FigoError.prototype.constructor = FigoError; @@ -20,5 +21,5 @@ FigoError.prototype.toString = function() { }; module.exports = { - FigoError: FigoError + FigoError: FigoError };