Skip to content

Commit

Permalink
fix: reaction 제일 많은 밈의 정보를 못 찾았을 때 에러 던지도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
seohyun0120 committed Aug 3, 2024
1 parent 3483ea8 commit 8d738d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/service/meme.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,14 @@ async function getTopReactionImage(keyword: IKeywordDocument): Promise<string> {
reaction: -1,
});

if (_.isNull(topReactionMeme)) {
throw new CustomError(`Failed get top reaction meme image`, HttpCode.NOT_FOUND);
}

logger.info(`Get top reaction meme - keyword(${keyword.name}), meme(${topReactionMeme._id})`);
return topReactionMeme.image;
} catch (err) {
logger.error(`Failed get top reaction meme`, err.message);
logger.error(`Failed get top reaction meme image`, err.message);
throw new CustomError(
`Failed get top reaction meme(${err.message})`,
HttpCode.INTERNAL_SERVER_ERROR,
Expand Down

0 comments on commit 8d738d3

Please sign in to comment.