Consider unifying the flow of `Gitlab::SubscriptionPortal:: Clients::Graphql` methods
We noticed a subtle bug in a multiple Gitlab::SubscriptionPortal:: Clients::Graphql
methods: see !141486 (comment 1722070167). In short, we sometimes mix :errors
/'errors'
(symbol/string) hash keys which results in ignoring some errors.
I've attempted to fix it in !141486 (merged), but I realized that many methods in the Gitlab::SubscriptionPortal:: Clients::Graphql
have a very similar structure/flow especially when it comes to handling errors.
You can notice it through the diff: !141486 (diffs)
We have an opportunity to unify the data flow and reduce duplication.
We can also consolidate how we recover from HTTP errors:
- in some methods, we rely on
RESCUABLE_HTTP_ERRORS
list defined explicitly in this file, - in other we use
http_post
, which in turn, doesrescue *Gitlab::HTTP::HTTP_ERRORS
=> They overlap but are not the same, and the reason for them being different is unclear. This could be unified as well.
Edited by Aleksei Lipniagov