Files
talk/plugins/talk-plugin-auth/server/errors.js
T
Wyatt Johnson 2e013c33ac GDPR Email Support
- Email and password can be used to create a new local profile
- Email can be changed with accounts that already have a local profile
2018-04-19 17:19:14 -06:00

26 lines
718 B
JavaScript

const { TalkError } = require('errors');
// ErrNoLocalProfile is returned when there is no existing local profile
// attached to a user.
class ErrNoLocalProfile extends TalkError {
constructor() {
super('No local profile associated with account', {
translation_key: 'NO_LOCAL_PROFILE',
status: 400,
});
}
}
// ErrLocalProfile is returned when a profile is already attached to a user and
// the user is trying to attach a new profile to it.
class ErrLocalProfile extends TalkError {
constructor() {
super('Local profile already associated with account', {
translation_key: 'LOCAL_PROFILE',
status: 400,
});
}
}
module.exports = { ErrLocalProfile, ErrNoLocalProfile };