Merge branch 'master' into asset-improvements

This commit is contained in:
David Erwin
2017-06-13 17:18:47 -04:00
committed by GitHub
12 changed files with 145 additions and 55 deletions
+15
View File
@@ -104,6 +104,20 @@ class ErrAuthentication extends APIError {
}
}
/**
* ErrAlreadyExists is returned when an attempt to create a resource failed due to an existing one.
*/
class ErrAlreadyExists extends APIError {
constructor(existing = null) {
super('resource already exists', {
translation_key: 'ALREADY_EXISTS',
status: 409
}, {
existing
});
}
}
// ErrContainsProfanity is returned in the event that the middleware detects
// profanity/wordlisted words in the payload.
const ErrContainsProfanity = new APIError('This username contains elements which are not permitted in our community. If you think this is in error, please contact us or try again.', {
@@ -178,6 +192,7 @@ const ErrAssetURLAlreadyExists = new APIError('Asset URL already exists, cannot
module.exports = {
ExtendableError,
APIError,
ErrAlreadyExists,
ErrPasswordTooShort,
ErrSettingsNotInit,
ErrMissingEmail,