Fix to parse API error
This commit is contained in:
parent
fe02b9e6af
commit
aa0f9563ac
4 changed files with 21 additions and 7 deletions
|
@ -4,7 +4,6 @@ import (
|
|||
"bufio"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
@ -95,7 +94,7 @@ func (c *Client) streaming(ctx context.Context, p string, tag string) (chan Even
|
|||
req.Header.Set("Authorization", "Bearer "+c.config.AccessToken)
|
||||
resp, err = c.Do(req)
|
||||
if resp != nil && resp.StatusCode != 200 {
|
||||
err = fmt.Errorf("bad request: %v", resp.Status)
|
||||
err = parseAPIError("bad request", resp)
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue