tonhowtf/omniget · error · anyhow::Error

NotFound

NotFound

Error message

Post not available

What it means

In `fetch_post` (src-tauri/src/platforms/bluesky/mod.rs:146), the AppView responded successfully but its JSON body contains `error: "NotFound"` or `"InternalServerError"`, which the code maps to the fixed message "Post not available". The post referenced by the URL could not be retrieved as a viewable thread.

Solutions

  1. Open the URL in a browser to confirm the post still exists and is publicly visible.
  2. Check whether the author's account is active and not blocking you.
  3. Validate the post id/rkey extracted from the URL for truncation or corruption.
  4. Treat this as terminal for the download and surface a user-friendly 'post unavailable' message.
Defensive patterns

Strategy: validation

Validate before calling

// resolve post existence before downloading:
// GET https://public.api.bsky.app/xrpc/app.bsky.feed.getPosts?uris=<at-uri>
// and check that a matching post entry with a non-'not found' view is returned

Try / catch

match fetch_post(&user, &post_id).await {
    Err(e) if e.to_string() == "Post not available" => {
        println!("The post was deleted or is not publicly visible.");
    }
    other => other?,
}

Prevention

When it happens

Trigger: The at-uri built from user/post_id points to a deleted post, a post from a deactivated/blocked account, or an invalid rkey the AppView can't resolve and reports as NotFound (or InternalServerError in edge cases).

Common situations: Post was deleted after the link was copied; author's account was suspended or deactivated; typos in the post id; private/blocked relationship preventing the viewer from seeing the post.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/8f81b8a0c033cfb6. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/src/platforms/bluesky/mod.rs:146

    async fn fetch_post(&self, user: &str, post_id: &str) -> anyhow::Result<serde_json::Value> {
        let uri = format!("at://{}/app.bsky.feed.post/{}", user, post_id);
        let url = format!(
            "{}?depth=0&parentHeight=0&uri={}",
            API_BASE,
            urlencoding::encode(&uri)
        );

        let response = self.client.get(&url).send().await?;

        if !response.status().is_success() {
            return Err(anyhow!("Bluesky API retornou HTTP {}", response.status()));
        }

        let json: serde_json::Value = response.json().await?;

        if let Some(error) = json.get("error").and_then(|e| e.as_str()) {
            return match error {
                "NotFound" | "InternalServerError" => Err(anyhow!("Post not available")),
                "InvalidRequest" => Err(anyhow!("Unsupported link")),
                _ => Err(anyhow!("Erro da API: {}", error)),
            };
        }

        Ok(json)
    }
}

enum BlueskyMedia {
    Video { hls_url: String },
    Images { urls: Vec<String> },
    Gif { url: String },
}

fn extract_media(embed: &serde_json::Value) -> Option<BlueskyMedia> {
    let embed_type = embed.get("$type")?.as_str()?;

View on GitHub (pinned to 8600b91f42)