tonhowtf/omniget · error
não consegui ler
Error message
não consegui ler {} What it means
This is a with_context-wrapped io::Error from std::fs::read when the tool could not read the user-supplied Letterboxd ZIP file at opts.zip_path. The context message interpolates the offending path, so 'não consegui ler <path>' identifies exactly which file failed to open.
Solutions
- Verify the path exists with fs::metadata before calling run and fix any typo.
- Re-download the ZIP from letterboxd.com/settings/data/ and pass the new path.
- Check file permissions and, on macOS, ensure the app has Files/Folder access.
- Alternatively drop the zip_path and provide Letterboxd session cookies so the tool downloads the export itself.
Example fix
// before
let opts = Options { zip_path: Some("~/Downloads/export.zip".into()), .. }; // ~ not expanded
run(&opts, p).await?;
// after
let expanded = shellexpand::tilde("~/Downloads/export.zip").to_string();
assert!(std::path::Path::new(&expanded).is_file(), "zip not found: {expanded}");
let opts = Options { zip_path: Some(expanded), .. };
run(&opts, p).await?; Defensive patterns
Strategy: validation
Validate before calling
if let Some(zip) = opts.zip_path.as_deref().map(str::trim) {
let meta = std::fs::metadata(zip)
.with_context(|| format!("não consegui ler {zip}"))?;
anyhow::ensure!(meta.is_file(), "{zip} não é um arquivo");
} Type guard
fn zip_readable(zip_path: &str) -> bool {
std::path::Path::new(zip_path.trim()).is_file()
} Try / catch
match letterboxd::run(&opts, &p).await {
Err(e) if e.to_string().starts_with("não consegui ler") => {
eprintln!("verifique o caminho do ZIP: {e}");
}
other => other?,
} Prevention
- Use absolute, fully expanded paths (no ~ or relative shortcuts)
- Re-download the export from letterboxd.com/settings/data/ if the file was moved or deleted
- Check app sandbox/permissions for reading user folders
- Verify existence with fs::metadata before constructing Options
When it happens
Trigger: Calling run with opts.zip_path pointing to a file that doesn't exist, was moved/deleted, or lacks read permission; std::fs::read(path) returns Err and it is propagated via the ? operator in run().
Common situations: Typo in the ZIP path; file downloaded to Downloads folder but a different path given; ZIP deleted between selection and run; permission restrictions (sandboxed app can't read user-chosen path).
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- o export veio sem nenhuma linha que eu saiba ler
- Failed to move into place
- Failed to replace
- Failed to open zip
- Failed to read zip entry
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/260b1940045c3129.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/lists/letterboxd.rs:372
let dest = PathBuf::from(opts.dest.trim());
if opts.dest.trim().is_empty() {
return Err(anyhow!("escolha a pasta de destino"));
}
std::fs::create_dir_all(&dest)?;
let f = Fetcher::new(opts.delay_ms, opts.session_netscape.as_deref(), DOMAIN)?;
// 1. O ZIP: local ou baixado com a sessão.
let (bytes, source) = match opts.zip_path.as_deref().map(str::trim) {
Some(path) if !path.is_empty() => {
report(&p, TOOL_ID, "progress", 0, Some(3), Some(path.to_string()));
(
std::fs::read(path).with_context(|| format!("não consegui ler {}", path))?,
path.to_string(),
)
}
_ => {
if !f.has_session() {
return Err(anyhow!(
"sem sessão do Letterboxd: capture os cookies de letterboxd.com na extensão, ou aponte um ZIP já baixado de letterboxd.com/settings/data/"
));
}
report(
&p,
TOOL_ID,
"progress",
0,
Some(3),
Some(EXPORT_URL.to_string()),
);
let (b, ctype) = f.get_bytes(EXPORT_URL).await?;
if ctype.contains("text/html") || b.len() < 200 {
let body = String::from_utf8_lossy(&b);
if is_cloudflare_wall(&body) {
return Err(anyhow!(
"o Cloudflare do Letterboxd barrou o download. Abra letterboxd.com no navegador, passe pelo \"Just a moment\" e capture os cookies de novo na extensão — o cf_clearance precisa vir junto"
));View on GitHub (pinned to 8600b91f42)