From d116ba00bd173e177fce98b9e89ac9d688f2d227 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Mon, 18 Mar 2024 07:14:43 +0100 Subject: [PATCH] Fix no error handling for comments --- sn.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sn.go b/sn.go index 604ca13..fb445fc 100644 --- a/sn.go +++ b/sn.go @@ -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 }