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

added idempotencyKey prop to ApiError #298

Merged
merged 6 commits into from
Dec 1, 2022

Conversation

janpaepke
Copy link
Collaborator

@janpaepke janpaepke commented Nov 29, 2022

For Details see #294 (comment) (Idea 3).

Changes:

  • ApiError constructor params are moved into an object
    1. With the addition of idempotencyKey the parameter list got unreadably long
    2. The order of the parameters does not matter
  • passing idempotencyKey from config in static ApiError.createFromResponse.
  • reverted header assignment (see Add retrying functionality #294 (comment))
  • exposing ApiError as MollieApiError for type-safe checks.
  • added tests

@janpaepke janpaepke changed the base branch from pimm+jan/advanced-ik to pimm+jan/retry December 1, 2022 14:41
@Pimm Pimm mentioned this pull request Dec 1, 2022
@Pimm Pimm deleted the branch mollie:master December 1, 2022 14:48
@Pimm Pimm closed this Dec 1, 2022
@Pimm Pimm reopened this Dec 1, 2022
@Pimm Pimm changed the base branch from pimm+jan/retry to master December 1, 2022 14:54
Pimm and others added 5 commits December 1, 2022 16:00
See #294 (comment).

This does introduce one breaking change. mollieClient.profiles.delete gained an argument, which means if you are calling it with a callback, you have to change your code. mollieClient.profiles.delete('id', success => …) becomes mollieClient.profiles.delete('id', {}, success => …). I feel this is so unlikely to affect anyone in the real world ‒ especially since the profiles binder is relatively new ‒ that it can be released as a minor version bump instead of a major one.
Copy link
Collaborator

@Pimm Pimm left a comment

Choose a reason for hiding this comment

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

I like how the error handling code is not unnecessarily interwoven with makeRetrying.

@Pimm Pimm merged commit 67e7fd9 into mollie:master Dec 1, 2022
@janpaepke janpaepke mentioned this pull request Dec 2, 2022
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.

2 participants