remove lastfm debug prints
This commit is contained in:
@@ -6,9 +6,7 @@ import (
|
|||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httputil"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
@@ -65,13 +63,9 @@ func (c *Client) makeRequest(method string, params url.Values) (LastFM, error) {
|
|||||||
decoder := xml.NewDecoder(resp.Body)
|
decoder := xml.NewDecoder(resp.Body)
|
||||||
lastfm := LastFM{}
|
lastfm := LastFM{}
|
||||||
if err = decoder.Decode(&lastfm); err != nil {
|
if err = decoder.Decode(&lastfm); err != nil {
|
||||||
respBytes, _ := httputil.DumpResponse(resp, true)
|
|
||||||
log.Printf("received bad lastfm response:\n%s", string(respBytes))
|
|
||||||
return LastFM{}, fmt.Errorf("decoding: %w", err)
|
return LastFM{}, fmt.Errorf("decoding: %w", err)
|
||||||
}
|
}
|
||||||
if lastfm.Error.Code != 0 {
|
if lastfm.Error.Code != 0 {
|
||||||
respBytes, _ := httputil.DumpResponse(resp, true)
|
|
||||||
log.Printf("received bad lastfm response:\n%s", string(respBytes))
|
|
||||||
return LastFM{}, fmt.Errorf("%v: %w", lastfm.Error.Value, ErrLastFM)
|
return LastFM{}, fmt.Errorf("%v: %w", lastfm.Error.Value, ErrLastFM)
|
||||||
}
|
}
|
||||||
return lastfm, nil
|
return lastfm, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user