add data to UnauthorizedError so that more information can be returned to client

This commit is contained in:
Vadim Kazakov
2014-07-16 14:12:18 -06:00
parent 870a274be9
commit 139843467b
2 changed files with 7 additions and 2 deletions

View File

@ -1,8 +1,12 @@
function UnauthorizedError (code, error) {
Error.call(this, error.message);
this.message = error.message;
this.code = code;
this.inner = error;
this.data = {
message: this.message,
code: code,
type: "UnauthorizedError"
};
}
UnauthorizedError.prototype = Object.create(Error.prototype);