fix error message

This commit is contained in:
Girish Ramakrishnan
2016-06-01 19:38:42 -07:00
parent 48b99a4203
commit 9cc6cb56f7

View File

@@ -45,7 +45,7 @@ function create(req, res, next) {
if (error && error.reason === UserError.BAD_EMAIL) return next(new HttpError(400, 'Invalid email'));
if (error && error.reason === UserError.BAD_PASSWORD) return next(new HttpError(400, 'Invalid password'));
if (error && error.reason === UserError.BAD_FIELD) return next(new HttpError(400, error.message));
if (error && error.reason === UserError.ALREADY_EXISTS) return next(new HttpError(409, 'Already exists'));
if (error && error.reason === UserError.ALREADY_EXISTS) return next(new HttpError(409, 'User already exists'));
if (error) return next(new HttpError(500, error));
var userInfo = {