{"record":{"id":"34cd13a0f9829ec0","repo":"tonhowtf/omniget","slug":"criar-perfil","errorCode":null,"errorMessage":"criar perfil: {}","messagePattern":"criar perfil: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/voicestudio.rs","lineNumber":311,"sourceCode":"            .text(\n                \"language\",\n                if opts.language.is_empty() {\n                    \"Auto\".to_string()\n                } else {\n                    opts.language.clone()\n                },\n            )\n            .part(\n                \"ref_audio\",\n                reqwest::multipart::Part::bytes(sample).file_name(file_name),\n            );\n        let j: serde_json::Value = c\n            .post(format!(\"{}/profiles\", b))\n            .multipart(form)\n            .send()\n            .await?\n            .error_for_status()\n            .map_err(|e| anyhow!(\"criar perfil: {}\", e))?\n            .json()\n            .await?;\n        profile_id = j\n            .get(\"id\")\n            .or_else(|| j.get(\"profile_id\"))\n            .and_then(|v| v.as_str())\n            .map(String::from);\n    }\n    super::report(&progress, \"voicestudio\", \"generate\", 0, None, None);\n    let mut form = reqwest::multipart::Form::new()\n        .text(\"text\", opts.text.clone())\n        .text(\"speed\", opts.speed.to_string())\n        .text(\"stream\", \"false\");\n    if !opts.language.is_empty() {\n        form = form.text(\"language\", opts.language.clone());\n    }\n    if let Some(pid) = &profile_id {\n        form = form.text(\"profile_id\", pid.clone());","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/voicestudio.rs#L293-L329","documentation":"clone_speak POSTs multipart data to {base}/profiles to create a voice profile and calls error_for_status(); any non-success HTTP status is wrapped as 'criar perfil: {}' (create profile: {}). It means the VoiceStudio server rejected the profile-creation request.","triggerScenarios":"The POST /profiles call returns 4xx/5xx: missing or invalid auth, a sample audio format the server rejects, duplicate profile name, or malformed multipart form.","commonSituations":"Invalid API token, uploading a sample in an unsupported codec, a profile name that already exists server-side, or VoiceStudio quota exhausted.","solutions":["Read the wrapped reqwest error for the status code; 401/403 → fix credentials, 400/422 → fix form fields.","Verify the API key and base URL used by the client.","Check the sample audio is a supported format and reasonable size before upload.","Rename or reuse the profile if the server rejects duplicates.","Retry with backoff on 429/5xx and check service health."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify auth and non-duplicate name before POST /profiles\nlet probe = client.get(format!(\"{}/profiles\", base)).send().await?;\nif !probe.status().is_success() {\n    return Err(format!(\"profile API unavailable: {}\", probe.status()));\n}","typeGuard":null,"tryCatchPattern":"match create_result {\n    Err(e) if e.to_string().contains(\"criar perfil\") => {\n        let s = e.to_string();\n        if s.contains(\"401\") || s.contains(\"403\") { /* fix credentials */ }\n        else if s.contains(\"409\") || s.contains(\"402\") { /* duplicate name: pick another save_as */ }\n        else if s.contains(\"413\") { /* sample too large: trim/convert audio */ }\n        else { /* retry with backoff or surface error */ }\n    }\n    other => other?,\n}","preventionTips":["Authenticate against a lightweight endpoint before profile creation.","Check codec/size support for the sample audio before upload.","Uniquify profile names (append timestamp) to avoid duplicate-name rejections.","Handle 429 with exponential backoff rather than immediate failure."],"tags":["http","api","network","rust"],"backgroundTag":"http-error-response","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"}