debug: log raw response on tweet create failure

This commit is contained in:
Lain Iwakura 2026-05-21 18:59:13 +03:00
parent 85c852f4bb
commit 9d847cd18e
Signed by: lain
GPG key ID: 8160466B2E8D1441

View file

@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt"
"io" "io"
"net/url" "net/url"
"strconv" "strconv"
@ -122,7 +123,8 @@ func (s *Scraper) CreateTweet(tweet NewTweet) (*Tweet, error) {
return result, nil return result, nil
} }
return nil, errors.New("tweet wasn't post") raw, _ := json.Marshal(response)
return nil, fmt.Errorf("tweet wasn't post: %s", raw)
} }
func (s *Scraper) DeleteTweet(tweetId string) error { func (s *Scraper) DeleteTweet(tweetId string) error {