#nachofranco14 - idempotency key

1 messages ยท Page 1 of 1 (latest)

candid stratus
#

Hi there!

#

What do you mean by

but just catching and retrying the APIError wouldn't solve it as it can be another kind of APIError.

barren solar
#

that if I could identify this kind of issue, I would retry until the error doesn't happen anymore

#

and that would mean that the first request was handled and the second received the response of the first one

#

because they shar ethe same idemp key

candid stratus
#

I'm sorry I don't follow. When you do get that error, it means another similar request is already being handled by Stripe. So you should catch that error, and you could check if the first request succeeded or not.

barren solar
#

exactly

#

but how can I catch the error

#

if it's not specific

#

APIError is not the same as DuplicatedRequestError

#

APIError is too general and I'm pretty sure it matches with other errors

#

@candid stratus or @tropic maple

tropic maple
#

๐Ÿ‘‹ give me a moment to catch up and I'll respond as soon as I can, thanks ๐Ÿ™‚

#

In this case, you'd likely want to look at the error code instead, code: "idempotency_key_in_use"

barren solar
#

sounds promising

#

where can I read about it?

#

is it documented anywhere?

tropic maple