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 => { ).then(res => {
return res && res.like return res && res.like
}).catch(function (error) { }).catch(function (error) {
console.error(error); if (error instanceof pgp.errors.QueryResultError && error.message.includes("No data returned from the query")) {
return undefined; // user hasn't liked building yet
return { error: 'It looks like you have not liked this building yet!' };
} else {
return undefined
console.error(error);
}
}); });
} }