1
0
Fork 0
arangodb/js/apps/system/_system/users/APP/errors.js

22 lines
593 B
JavaScript

'use strict';
class UserNotFound extends Error {
constructor(uid) {
super();
this.name = this.constructor.name;
this.message = `User with user id ${uid} not found.`;
Error.captureStackTrace(this, this.constructor);
}
}
class UsernameNotAvailable extends Error {
constructor(username) {
super();
this.name = this.constructor.name;
this.message = `The username ${username} is not available or already taken.`;
Error.captureStackTrace(this, this.constructor);
}
}
exports.UserNotFound = UserNotFound;
exports.UsernameNotAvailable = UsernameNotAvailable;