Skip to content

Commit

Permalink
If there's an err, return it :)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwmarrin committed Dec 27, 2017
1 parent 2c2b016 commit b58212a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions restapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,7 @@ func (s *Session) GuildRoleEdit(guildID, roleID, name string, color int, hoist b
// Prevent sending a color int that is too big.
if color > 0xFFFFFF {
err = fmt.Errorf("color value cannot be larger than 0xFFFFFF")
return nil, err
}

data := struct {
Expand Down Expand Up @@ -1022,6 +1023,9 @@ func (s *Session) GuildPruneCount(guildID string, days uint32) (count uint32, er

uri := EndpointGuildPrune(guildID) + fmt.Sprintf("?days=%d", days)
body, err := s.RequestWithBucketID("GET", uri, nil, EndpointGuildPrune(guildID))
if err != nil {
return
}

err = unmarshal(body, &p)
if err != nil {
Expand Down

0 comments on commit b58212a

Please sign in to comment.