Revert "[ka6] fix connecteur foodcrayon.com: 8e application du fix 402 (revert-du-revert de a659395, qui avait annulé le 7e sauvetage 08b19de — guerre de reverts, même pattern que multibrosses/_get_list, artisansduvitrail/_seq et labete/_woo_uninstalled). Cause racine re-vérifiée live le 2026-09-22: foodcrayon.com et www répondent toujours HTTP 402 {"errors":"Unavailable Shop"} (abonnement Shopify gelé) sur /products.json. Sans le fix, le 402 épuise 6 retries curl + 3 Scrapfly puis propage une erreur → broken (37+ échecs consécutifs); avec: 402 = _StorefrontLockedError comme le 401 (chemin direct code in ("401","402") + fallback Scrapfly upstream 402) → catalogue vide fidèle à la source, sync ok. Sync réel 2026-09-22: foodcrayon.com ok / 0 produit (= médiane 0.0, zéro légitime); non-régression lulobaceramics.ca (47 produits, 0 erreur, chemin 200 intact). pm2 restart fabri-ka-sync fait, web local 200. NE PAS RE-REVERTER tant que le site répond 402."
This reverts commit c17406f36cfe037ffa341c4886e64ec373751401.
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) ; HTTP 402 : boutique | |
| 32 | − gelée « Unavailable Shop » (abonnement Shopify impayé, ex. foodcrayon.com) | |
| 33 | − — rien n'est vendu publiquement, catalogue vide fidèle à la source, | |
| 34 | − 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 | |