summaryrefslogtreecommitdiff
path: root/internal/platforms/linkedin
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-02-08 23:04:38 +0200
committerPaul Buetow <paul@buetow.org>2025-02-08 23:04:38 +0200
commitde5af3fcb6be79d1abdc7c9bdf1df6143d29c383 (patch)
treeabacb158523e52a74155b38c8dab7a46dcef0862 /internal/platforms/linkedin
parent8fbc04cfdf939ee2a0b76cc267b31e01038aa955 (diff)
bugfix
Diffstat (limited to 'internal/platforms/linkedin')
-rw-r--r--internal/platforms/linkedin/linkedin.go6
1 files changed, 5 insertions, 1 deletions
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
}