From de5af3fcb6be79d1abdc7c9bdf1df6143d29c383 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 8 Feb 2025 23:04:38 +0200 Subject: bugfix --- internal/platforms/linkedin/linkedin.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'internal/platforms/linkedin') diff --git a/internal/platforms/linkedin/linkedin.go b/internal/platforms/linkedin/linkedin.go index 9c6f7b9..2a3c7b2 100644 --- a/internal/platforms/linkedin/linkedin.go +++ b/internal/platforms/linkedin/linkedin.go @@ -224,7 +224,11 @@ func performImageUpload(ctx context.Context, imagePath, uploadURL, accessToken s fmt.Println(string(body)) if resp.StatusCode != http.StatusCreated { - return fmt.Errorf("upload failed with status %s: %s", resp.Status, string(body)) + err := fmt.Errorf("upload failed with status %s: %s", resp.Status, string(body)) + if resp.StatusCode == http.StatusUnauthorized { + err = errors.Join(err, errUnauthorized) + } + return err } return nil } -- cgit v1.2.3