v1.16.8
This commit is contained in:
@@ -210,7 +210,7 @@ func (dc *DecortClient) getToken(ctx context.Context) error {
|
||||
}
|
||||
|
||||
if resp.StatusCode != 200 {
|
||||
return fmt.Errorf("cannot get token: %s", tokenBytes)
|
||||
return newHTTPError("cannot get token", resp.StatusCode, tokenBytes)
|
||||
}
|
||||
|
||||
// save token in config
|
||||
@@ -297,8 +297,7 @@ func (dc *DecortClient) do(req *http.Request, ctype string) ([]byte, error) {
|
||||
}
|
||||
|
||||
// handle errors with status code other than 200
|
||||
err = fmt.Errorf("%s", respBytes)
|
||||
return nil, fmt.Errorf("could not execute request: %w", err)
|
||||
return nil, newHTTPError("could not execute request", resp.StatusCode, respBytes)
|
||||
}
|
||||
|
||||
// isConnectionError checks if given error falls within specific and associated connection errors
|
||||
@@ -444,7 +443,7 @@ func getTokenExp(token string) (time.Time, error) {
|
||||
|
||||
exp, ok := claims["exp"]
|
||||
if !ok {
|
||||
return time.Time{}, fmt.Errorf("exp time bot found")
|
||||
return time.Time{}, fmt.Errorf("exp time not found")
|
||||
}
|
||||
|
||||
expTime := time.Unix(int64(exp.(float64)), 0)
|
||||
|
||||
Reference in New Issue
Block a user