tonhowtf/omniget · error
escolha pelo menos um arquivo
Error message
escolha pelo menos um arquivo
What it means
publish_web validates that the PublishRequest contains at least one file before doing any upload; an empty req.files list immediately fails with 'escolha pelo menos um arquivo' (choose at least one file).
Solutions
- Check req.files is non-empty in the UI/API layer before calling publish_web
- Ensure the client serializes the files array correctly
- Return a validation error to the user prompting a file selection
Example fix
// before
// calling publish_web directly with an empty request
// after
if (req.files.length === 0) { alert('escolha pelo menos um arquivo'); return; } Defensive patterns
Strategy: validation
Validate before calling
if (!req.files || req.files.length === 0) {
throw new Error('escolha pelo menos um arquivo');
} Type guard
function hasFiles(req) { return Array.isArray(req.files) && req.files.length > 0; } Try / catch
try { await publish_web(req) } catch (e) { if (String(e).includes('escolha pelo menos um arquivo')) { promptFileSelection(); } else { throw e; } } Prevention
- Disable the publish button until files are selected
- Validate the request payload in the UI layer
- Serialize the files array explicitly in the client
When it happens
Trigger: Calling publish_web with kind photo/video/carousel and req.files == [].
Common situations: Frontend sends a publish request before the user selected files, or a file-picker bug drops the selection from the payload.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- um carrossel tem de 2 a 20 arquivos
- escolha a pasta de destino para organizar
- informe um appid, um link da loja ou marque a biblioteca…
- pasta de origem não encontrada
- escolha a pasta da biblioteca de destino
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/c3531292c3404359.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/instagram/publish.rs:303
if req.hide_like_counts { "1" } else { "0" }.into(),
),
("custom_accessibility_caption", req.alt_text.clone()),
("usertags", "".into()),
("archive_only", "false".into()),
("is_meta_only_post", "0".into()),
]
}
/// Publica pela sessão web.
pub async fn publish_web(
client: &IgClient,
req: &PublishRequest,
progress: &super::super::ProgressFn,
job: &str,
) -> anyhow::Result<PublishResult> {
let id = format!("ig:{}", job);
if req.files.is_empty() {
return Err(anyhow!("escolha pelo menos um arquivo"));
}
let report = |stage: &str, done: u64, total: u64| {
super::super::report(progress, &id, stage, done, Some(total), None)
};
let m = |e: IgError| anyhow!(e.to_string());
match req.kind.as_str() {
"photo" => {
report("upload", 0, 2);
let uid = upload_id();
let (bytes, w, h) = as_jpeg(Path::new(&req.files[0])).await?;
rupload_photo(client, bytes, w, h, &uid, &[])
.await
.map_err(m)?;
report("configure", 1, 2);
let json = client
.post_form("/api/v1/media/configure/", &common_form(req, &uid))
.await
.map_err(m)?;View on GitHub (pinned to 8600b91f42)