How should I detect and handle “The quantities couldn’t be moved. Try again.” errors in the Shopify GraphQL API: inventoryMoveQuantities?

I’m currently working on an integration using the Shopify Admin GraphQL API, and I occasionally encounter the following error when calling the inventoryMoveQuantities or inventoryAdjustQuantities mutation:

The quantities couldn’t be moved. Try again.
(or The quantities couldn’t be adjusted. Try again.)

In a previous discussion on the Shopify Community, I learned that this error is usually caused by concurrency or internal locking issues — when multiple requests try to update the same inventory item at the same time.

Based on that advice, I’ve updated my app to avoid sending concurrent requests for the same inventory item. However, I’d still like to implement a retry mechanism in case this error occurs again.

At the moment, I’m detecting the error by checking the message text (for example, "The quantities couldn’t be moved. Try again.").
But as mentioned in that discussion, relying on error messages or error codes isn’t ideal because they may change without notice.

So my question is:
:backhand_index_pointing_right: What’s the recommended or most reliable way to detect this type of transient “try again” error in GraphQL responses?

Any guidance or best practices would be greatly appreciated.
Thank you!

For discussion,I guess u could serialize the operations of modifying the inventory of the same product item before performing it.