Fix no error handling for comments

This commit is contained in:
ekzyis 2024-03-18 07:14:43 +01:00
parent a3933b48c6
commit d116ba00bd
1 changed files with 3 additions and 1 deletions

4
sn.go
View File

@ -94,7 +94,9 @@ func PostStoryToStackerNews(story *Story, options PostStoryOptions) (int, error)
HackerNewsItemLink(story.ID),
story.Score, story.Descendants,
)
sn.CreateComment(parentId, comment)
if _, err := sn.CreateComment(parentId, comment); err != nil {
return -1, fmt.Errorf("error posting comment :%w", err)
}
return parentId, nil
}