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

Commit 867cf5e

Browse files
committed
Fix typo in Error handling controller code
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.
1 parent 2c319c5 commit 867cf5e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/controllers/errors.server.controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ var getUniqueErrorMessage = function(err) {
88

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

1313
} catch(ex) {
14-
output = 'Unique field already exist';
14+
output = 'Unique field already exists';
1515
}
1616

1717
return output;
@@ -39,4 +39,4 @@ exports.getErrorMessage = function(err) {
3939
}
4040

4141
return message;
42-
};
42+
};

0 commit comments

Comments
 (0)