{"record":{"id":"7d839b8ab1e6f5a7","repo":"tonhowtf/omniget","slug":"pinterest-http","errorCode":null,"errorMessage":"Pinterest: {} (HTTP {})","messagePattern":"Pinterest: (.+?) \\(HTTP (.+?)\\)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/pinterest/api.rs","lineNumber":923,"sourceCode":"                    .as_str()\n                    .or_else(|| rr[\"error\"][\"message\"].as_str())\n                    .unwrap_or(\"resposta sem status de sucesso\");\n                let code = rr[\"error\"][\"http_status\"]\n                    .as_u64()\n                    .unwrap_or(status.as_u16() as u64);\n                if code == 404 {\n                    return Err(anyhow!(\n                        \"nao encontrado no Pinterest (privado, removido ou URL errada): {}\",\n                        msg\n                    ));\n                }\n                if code == 401 || code == 403 {\n                    return Err(anyhow!(\n                        \"o Pinterest negou o acesso ({}); para boards secretos informe os cookies\",\n                        msg\n                    ));\n                }\n                return Err(anyhow!(\"Pinterest: {} (HTTP {})\", msg, code));\n            }\n            let bookmark = body[\"resource\"][\"options\"][\"bookmarks\"]\n                .as_array()\n                .and_then(|a| a.first())\n                .and_then(|b| b.as_str())\n                .map(|b| b.to_string())\n                .or_else(|| rr[\"bookmark\"].as_str().map(|b| b.to_string()))\n                .filter(|b| b != \"-end-\" && !b.starts_with(\"Y2JOb25lO\"));\n            return Ok((rr[\"data\"].clone(), bookmark));\n        }\n    }\n\n    pub async fn pin(&self, id: &str) -> anyhow::Result<Pin> {\n        let (data, _) = self\n            .resource(\n                \"Pin\",\n                json!({ \"id\": id, \"field_set_key\": \"detailed\" }),\n                &format!(\"/pin/{}/\", id),","sourceCodeStart":905,"sourceCodeEnd":941,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/pinterest/api.rs#L905-L941","documentation":"Catch-all for Pinterest error responses that are neither 404 nor 401/403: the client throws \"Pinterest: {message} (HTTP {code})\" carrying Pinterest's error message and status. It signals an upstream API failure outside the specifically handled cases.","triggerScenarios":"Pinterest responding with any other error status — 429 rate limiting, 5xx server errors, 400 bad request — with a JSON body containing an error message.","commonSituations":"Request bursts hitting Pinterest rate limits (429); temporary Pinterest outages (5xx); malformed parameters rejected with 400; region-blocked requests.","solutions":["Read the HTTP code in the message: retry with exponential backoff for 429/5xx, fix the request for 4xx.","Throttle request rate and add jitter if you see 429 repeatedly.","Check Pinterest's status/platform for ongoing incidents on 5xx.","Validate request parameters/URLs for 400 responses."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match fetch() {\n    Err(e) if e.to_string().contains(\"(HTTP 429)\") || e.to_string().contains(\"(HTTP 5\") => {\n        tokio::time::sleep(backoff).await; // exponential backoff + jitter\n        retry();\n    }\n    other => other?,\n}","preventionTips":["Rate-limit requests to Pinterest (token bucket or fixed spacing) to avoid 429s.","Implement exponential backoff with jitter for 429/5xx responses.","Differentiate 4xx (fix request) from 429/5xx (retry) using the code in the message.","Monitor Pinterest status for outages before large batch runs."],"tags":["pinterest","http","api","rate-limit"],"backgroundTag":"upstream-api-error","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}