1
0
Fork 0

Prettier stacks for users app errors.

This commit is contained in:
Alan Plum 2014-08-21 16:39:50 +02:00
parent 19062d9d57
commit c42628f0c5
1 changed files with 6 additions and 0 deletions

View File

@ -5,11 +5,17 @@
function UserNotFound(uid) {
this.message = 'User with user id ' + uid + ' not found.';
var err = new Error(this.message);
err.name = this.constructor.name;
this.stack = err.stack;
}
UserNotFound.prototype = new Error();
function UsernameNotAvailable(username) {
this.message = 'The username ' + username + ' is not available or already taken.';
var err = new Error(this.message);
err.name = this.constructor.name;
this.stack = err.stack;
}
UsernameNotAvailable.prototype = new Error();