Skip to content

HTTP rate limit errors are not propagated.  #72

@smettu1

Description

@smettu1

Github graphql errors.

We were running a lot of graphql queries using multiple coroutines, we were running into issues where data returned is null.
In this case, we assume there is no more data from Github and stop the iteration. Eventually, we realized that data that we have doesn't match up with that of Github. Further debugging we found that we were getting secondary rate limit errors which were not sent back to the client.

Function:
c.runWithJSON(ctx, req, resp)

	res, err := c.httpClient.Do(r)
	if err != nil {
		return err
	}
	defer res.Body.Close()

Does not propagate 403 rate limit errors , in which case if there is 403 library will try to read the data and pass it upstream.
Example error message:

"documentation_url": "https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits",
  "message": "You have exceeded a secondary rate limit. Please wait a few minutes before you try again."

Sample fix:

if res.StatusCode != 200 {
return errors.Wrap(err, "status code error ")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions