check response
This commit is contained in:
parent
e7f2469bc0
commit
0579b31633
|
@ -94,7 +94,7 @@ func (c *Client) streaming(ctx context.Context, p string, tag string) (chan Even
|
|||
if err == nil {
|
||||
req.Header.Set("Authorization", "Bearer "+c.config.AccessToken)
|
||||
resp, err = c.Do(req)
|
||||
if resp.StatusCode != 200 {
|
||||
if resp != nil && resp.StatusCode != 200 {
|
||||
err = fmt.Errorf("bad request: %v", resp.Status)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user