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

Add response to beforeRetry hook and change its parameter to a single object #201

Merged
merged 10 commits into from Feb 21, 2020

Conversation

lkostrowski
Copy link
Contributor

@lkostrowski lkostrowski commented Nov 10, 2019

Fixes #194

@sholladay
Copy link
Collaborator

Should we make all hooks take an object for consistency? Or only once they grow to this many arguments?

Also, what do you think of my idea to attach the response to the request as request.response?

@lkostrowski
Copy link
Contributor Author

  1. Yes, maybe all hooks should be changed if we aim for breaking changes anyway
  2. I think Response isn't exactly a part of Request. Also you mess with native interface. IMO It should be left separated

@sindresorhus
Copy link
Owner

Should we make all hooks take an object for consistency? Or only once they grow to this many arguments?

Yeah, let's change the other ones too.

@sindresorhus
Copy link
Owner

You need to update the readme (https://github.com/sindresorhus/ky#hooksbeforeretry), examples, and relevant tests too.

@sindresorhus
Copy link
Owner

@lkostrowski Bump :)

@lkostrowski
Copy link
Contributor Author

Sorry I was on vacation. I will try to finish it during xmas

@sindresorhus
Copy link
Owner

Bump :)

@lkostrowski
Copy link
Contributor Author

Should be fine, sorry for delay

@sindresorhus
Copy link
Owner

You need to update the readme (sindresorhus/ky#hooksbeforeretry)

You need to update the docs text too, not just the examples.

@sindresorhus sindresorhus changed the title Add response to beforeRetry hook and change its params to single object Add response to beforeRetry hook and change its parameter to a single object Feb 21, 2020
@sindresorhus sindresorhus merged commit 3f3e14d into sindresorhus:master Feb 21, 2020
@sindresorhus
Copy link
Owner

Thanks :)

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.

beforeRetry hook should expose failed response
3 participants