Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenerateIfExpired ignores an error #111

Closed
wants to merge 2 commits into from

Conversation

yoheimuta
Copy link

Make sure to return an error if GenerateIfExpired fails.

func (c *Client) setTokenHeader(r *http.Request) error {
_, err := c.Token.GenerateIfExpired()
if err != nil {
return err
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behavior changes. The default may be better to ignore errors as before.

@coveralls
Copy link

coveralls commented Jul 9, 2018

Coverage Status

Coverage decreased (-0.9%) to 90.835% when pulling 26c8b8c on yoheimuta:avoid-ignore-error into c6554af on sideshow:master.

@sideshow
Copy link
Owner

sideshow commented Sep 7, 2019

Thanks for the PR. In hindsight it wasn't the best decision to ignore the error, but currently if token generation fails then it will just return 401, and the token will try and regenerate on the next push.

As you picked up this PR would change the behaviour so it's probably better to leave as is. Thanks

@sideshow sideshow closed this Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants