changed custom error to standardized error

This commit is contained in:
Wyatt Johnson
2017-10-04 10:35:55 -06:00
parent 69c03c9190
commit d85db01752
+2 -2
View File
@@ -15,14 +15,14 @@ const getActionItem = async ({loaders: {Comments, Users}}, {item_id, item_type})
if (item_type === 'COMMENTS') {
const comment = await Comments.get.load(item_id);
if (!comment) {
throw new Error('Comment not found');
throw errors.ErrNotFound;
}
return comment;
} else if (item_type === 'USERS') {
const user = await Users.getByID.load(item_id);
if (!user) {
throw new Error('User not found');
throw errors.ErrNotFound;
}
return user;