Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Fix typo in Error handling controller code
Browse files Browse the repository at this point in the history
On the frontend, the error message 'Username already exist' appears when creating a user with the same username as an existing user.  Grammatically, this error looks strange.  A more proper error message would be 'Username already exists'.  Possibly later on support can be added to properly conjugate this error message for a 'plural' field.
  • Loading branch information
macsj200 committed Aug 7, 2014
1 parent 2c319c5 commit 867cf5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/errors.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ var getUniqueErrorMessage = function(err) {

try {
var fieldName = err.err.substring(err.err.lastIndexOf('.$') + 2, err.err.lastIndexOf('_1'));
output = fieldName.charAt(0).toUpperCase() + fieldName.slice(1) + ' already exist';
output = fieldName.charAt(0).toUpperCase() + fieldName.slice(1) + ' already exists';

} catch(ex) {
output = 'Unique field already exist';
output = 'Unique field already exists';
}

return output;
Expand Down Expand Up @@ -39,4 +39,4 @@ exports.getErrorMessage = function(err) {
}

return message;
};
};

0 comments on commit 867cf5e

Please sign in to comment.