Skip to content

Commit 99811b5

Browse files
committed
error when emote mutations get a wrong statuscode
1 parent 782dd0b commit 99811b5

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

seventvapi/addemote.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ mutation EmoteSets {
6363
return err
6464
}
6565

66+
if resp.StatusCode != 200 {
67+
return fmt.Errorf("AddEmote failed with code %d, body=%q", resp.StatusCode, body)
68+
}
69+
6670
var result struct {
6771
Errors []struct {
6872
Message string `json:"message"`

seventvapi/removeemote.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ mutation EmoteSets {
8181
return err
8282
}
8383

84+
if resp.StatusCode != 200 {
85+
return fmt.Errorf("RemoveEmote failed with code %d, body=%q", resp.StatusCode, body)
86+
}
87+
8488
var result struct {
8589
Errors []struct {
8690
Message string `json:"message"`

0 commit comments

Comments
 (0)