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: error object to custom retry callback #337

Merged
merged 14 commits into from
Jan 4, 2024

Conversation

MikePresman
Copy link
Contributor

@MikePresman MikePresman commented Dec 19, 2023

This change introduces passing the error object to the custom retry callback; something that should've been done in the initial implementation of this feature but forgotten. Alas this PR introduces passing the error object to the callback.

Checklist

@MikePresman MikePresman changed the title pass error to the callback + test + update docs add: error object to custom retry callback Dec 19, 2023
README.md Outdated Show resolved Hide resolved
@MikePresman MikePresman force-pushed the add/err-to-custom-retries branch 2 times, most recently from 37639f1 to 958ecd4 Compare December 19, 2023 22:29
@airhorns
Copy link
Member

@MikePresman want to just include the types PR in this one and adjust the types, and we can merge it together and close the other one?

types/index.test-d.ts Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@mcollina
Copy link
Member

mcollina commented Jan 2, 2024

There are a lot of CI failures

index.js Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
@MikePresman
Copy link
Contributor Author

MikePresman commented Jan 2, 2024

Apologies about the previous failing tests and lint, had pushed and it slipped my mind to check when I grabbed lunch. All should be well now.

Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

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

lgtm, breaking change

@Eomm
Copy link
Member

Eomm commented Jan 2, 2024

Not a major, this feature is not yet released
Here is the discussion
#337 (comment)

I'm not going to approve as my comment is not solved, feel free to land it if you disagree 👍

@Eomm Eomm removed the semver-major label Jan 2, 2024
@MikePresman
Copy link
Contributor Author

Not a major, this feature is not yet released Here is the discussion #337 (comment)

I'm not going to approve as my comment is not solved, feel free to land it if you disagree 👍

Could you please clarify, I've made the change to interfacing the function args as an object which is what I believe was the core of your comment unless you meant

The most common use I see:
after 4 retries I want to log the message, otherwise ignore it.

For this reason I think this object will change soonish

passing the logger is something you want in this PR.

@gurgunday
Copy link
Member

I'm not going to approve as my comment is not solved, feel free to land it if you disagree 👍

I personally wouldn't merge without making sure that we're all in agreement

Hasn't your proposal been implemented?

…ods && add the attempt to the callback object
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
test/retry-with-a-custom-handler.test.js Show resolved Hide resolved
@airhorns airhorns self-requested a review January 2, 2024 21:51
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@MikePresman
Copy link
Contributor Author

MikePresman commented Jan 3, 2024

Not sure why my above type definition change would have failed the test as no functional changes between HEAD and HEAD~1 should have led to this imo. Could someone kindly re run it? I'm unable to reproduce this on my macos machine.

Edit: It was reran thank you.

@Uzlopak
Copy link
Contributor

Uzlopak commented Jan 3, 2024

@MikePresman

Did you address all remarks of @airhorns ? If so, could you comment on them accordingly and resolve them please?

Copy link
Member

@airhorns airhorns left a comment

Choose a reason for hiding this comment

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

LGTM after comments

types/index.d.ts Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
types/index.test-d.ts Outdated Show resolved Hide resolved
types/index.test-d.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

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

RSLGTM

@mcollina mcollina merged commit 5f3fbb9 into fastify:master Jan 4, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants