mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
Use resty response.IsSuccess() instead of checking for status code 200
This commit is contained in:
parent
3f1bebd8ed
commit
357932f9b0
5 changed files with 12 additions and 12 deletions
|
@ -58,7 +58,7 @@ func (c Client) GetScrobbles(page int, perPage int) (result GetScrobblesResult,
|
|||
SetResult(&result).
|
||||
Get(path)
|
||||
|
||||
if response.StatusCode() != 200 {
|
||||
if !response.IsSuccess() {
|
||||
err = errors.New(response.String())
|
||||
return
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ func (c Client) NewScrobble(scrobble NewScrobble) (result NewScrobbleResult, err
|
|||
SetResult(&result).
|
||||
Post(path)
|
||||
|
||||
if response.StatusCode() != 200 {
|
||||
if !response.IsSuccess() {
|
||||
err = errors.New(response.String())
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue