Revert "[ka6] fix connecteur foodcrayon.com: 3e application du fix 402 (revert du revert a1767c2, qui avait annulé 545fb6c, lui-même sauvetage de ba9ae40) — le site renvoie toujours HTTP 402 « Store unavailable » (abonnement Shopify gelé, vérifié live foodcrayon.com + www le 2026-09-05). Sans le fix, le 402 épuise 6 retries curl + 3 Scrapfly puis propage une erreur (4 échecs consécutifs → broken); avec le fix, 402 = _StorefrontLockedError comme le 401 (direct + fallback Scrapfly): catalogue vide fidèle à la source, sync ok. Ce fix a maintenant été perdu 2× par des reverts concurrents — ne pas le re-reverter tant que le site répond 402."
This reverts commit 3d21610d3d084354acd5c5c5b2f2424440412074.
1 changed file +5 −7
modified
fabrika/connectors/shopify.py
+5 −7
@@ -28,10 +28,8 @@ class _PageCapError(RuntimeError): | ||
| 28 | 28 | |
| 29 | 29 | class _StorefrontLockedError(RuntimeError): |
| 30 | 30 | """HTTP 401 sur /products.json : storefront verrouillé par mot de passe |
| 31 | − (mode « Bientôt ouvert », ex. fermeail-land.com), ou HTTP 402 : boutique | |
| 32 | − gelée par Shopify pour abonnement impayé (« Store unavailable », | |
| 33 | − ex. foodcrayon.com) — rien n'est vendu publiquement, catalogue vide | |
| 34 | − fidèle à la source, pas une panne.""" | |
| 31 | + (mode « Bientôt ouvert », ex. fermeail-land.com) — rien n'est vendu | |
| 32 | + publiquement, catalogue vide fidèle à la source, pas une panne.""" | |
| 35 | 33 | |
| 36 | 34 | |
| 37 | 35 | class ShopifyConnector(BaseConnector): |
@@ -78,8 +76,8 @@ class ShopifyConnector(BaseConnector): | ||
| 78 | 76 | last_err = RuntimeError("429 Too Many Requests") |
| 79 | 77 | elif code == "400": |
| 80 | 78 | raise _PageCapError(f"HTTP 400 {url}") |
| 81 | − elif code in ("401", "402"): | |
| 82 | − raise _StorefrontLockedError(f"HTTP {code} {url}") | |
| 79 | + elif code == "401": | |
| 80 | + raise _StorefrontLockedError(f"HTTP 401 {url}") | |
| 83 | 81 | else: |
| 84 | 82 | last_err = RuntimeError(f"HTTP {code or 'error'} {p.stderr[:120]}") |
| 85 | 83 | time.sleep(2) |
@@ -106,7 +104,7 @@ class ShopifyConnector(BaseConnector): | ||
| 106 | 104 | except Exception as exc: |
| 107 | 105 | if "upstream 400" in str(exc): |
| 108 | 106 | raise _PageCapError(str(exc)) from exc |
| 109 | − if "upstream 401" in str(exc) or "upstream 402" in str(exc): | |
| 107 | + if "upstream 401" in str(exc): | |
| 110 | 108 | raise _StorefrontLockedError(str(exc)) from exc |
| 111 | 109 | last_err = exc |
| 112 | 110 | time.sleep(3 * (attempt + 1)) |
| 113 | 111 | |