log error saving post in sentiment service

This commit is contained in:
Asim Aslam
2021-03-03 14:38:11 +00:00
parent de0bba2a03
commit 7daa0822f1

View File

@@ -29,7 +29,7 @@ func EnrichPost(ctx context.Context, post *pb.Post) error {
logger.Infof("Setting score %.1f for post '%v'", score, post.Title) logger.Infof("Setting score %.1f for post '%v'", score, post.Title)
// now save the post // now save the post
PostsClient.Save(ctx, &pb.SaveRequest{ _, err := PostsClient.Save(ctx, &pb.SaveRequest{
Id: post.Id, Id: post.Id,
Title: post.Title, Title: post.Title,
Content: post.Content, Content: post.Content,
@@ -39,6 +39,9 @@ func EnrichPost(ctx context.Context, post *pb.Post) error {
Image: post.Image, Image: post.Image,
Slug: post.Slug, Slug: post.Slug,
}) })
if err != nil {
logger.Info("Error saving post: %v", err)
}
return nil return nil
} }