fix error message string

This commit is contained in:
Berkeley Martinez
2015-08-04 10:52:41 -07:00
parent c8488c8419
commit 70c5bcea20

View File

@ -161,9 +161,9 @@ module.exports = function(User) {
if (!username) { if (!username) {
// Zalgo!! // Zalgo!!
return nextTick(() => { return nextTick(() => {
cb( cb(new TypeError(
new TypeError('FCC: username should be a string but got %s', username) `username should be a string but got ${ username }`
); ));
}); });
} }
User.findOne({ where: { username } }, (err, user) => { User.findOne({ where: { username } }, (err, user) => {
@ -171,7 +171,7 @@ module.exports = function(User) {
return cb(err); return cb(err);
} }
if (!user || user.username !== username) { if (!user || user.username !== username) {
return cb(new Error('FCC: no user found for %s', username)); return cb(new Error(`no user found for ${ username }`));
} }
const aboutUser = getAboutProfile(user); const aboutUser = getAboutProfile(user);
return cb(null, aboutUser); return cb(null, aboutUser);