Attempt to fix issue #216-Reduce log noise

This commit is contained in:
Martin-dJ 2019-03-14 12:32:49 +00:00
parent d692db6c19
commit c83f2bc0c2

View File

@ -90,8 +90,13 @@ function getBuildingLikeById(building_id, user_id) {
).then(res => {
return res && res.like
}).catch(function (error) {
if (error instanceof pgp.errors.QueryResultError && error.message.includes("No data returned from the query")) {
// user hasn't liked building yet
return { error: 'It looks like you have not liked this building yet!' };
} else {
return undefined
console.error(error);
return undefined;
}
});
}