summaryrefslogtreecommitdiff
path: root/internal/platforms/linkedin
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-10-22 21:47:57 +0300
committerPaul Buetow <paul@buetow.org>2024-10-22 21:47:57 +0300
commit66327b1e5b03eb8f3eeb178e385c902e18afecae (patch)
tree414a2cc1dcf9510e2043a39837de102da917553a /internal/platforms/linkedin
parent38eb6dda4c2084440e42e5667ab182592498016f (diff)
change color
Diffstat (limited to 'internal/platforms/linkedin')
-rw-r--r--internal/platforms/linkedin/linkedin.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/platforms/linkedin/linkedin.go b/internal/platforms/linkedin/linkedin.go
index f6d89f5..ff58b06 100644
--- a/internal/platforms/linkedin/linkedin.go
+++ b/internal/platforms/linkedin/linkedin.go
@@ -93,13 +93,16 @@ func callLinkedInAPI(ctx context.Context, personID, accessToken, content string)
if err != nil {
return err
}
- color.Cyan(string(body))
if resp.StatusCode != http.StatusCreated {
- err = fmt.Errorf("failed to post to LinkedIn. Status: %s\n", resp.Status)
+ err = fmt.Errorf("failed to post to LinkedIn. Status: %s\n%s\n",
+ resp.Status, string(body))
if resp.StatusCode == http.StatusUnauthorized {
err = errors.Join(err, errUnauthorized)
}
}
+ if err == nil {
+ color.New(color.FgWhite, color.BgGreen).Println("Successfully posted message to LinkedIn")
+ }
return err
}