Skip to content

Commit

Permalink
raise non-200 response
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqzss committed Dec 13, 2024
1 parent 3ec170c commit ec49d07
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func requestDouga(client *http.Client, acId string) ([]byte, error) {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
return nil, fmt.Errorf("status code: %d", resp.StatusCode)
}

body, err := io.ReadAll(resp.Body)
if err != nil {
Expand Down

0 comments on commit ec49d07

Please sign in to comment.