zeroclaw-labs/zeroclaw · error · anyhow::Error

ms365: downloaded file exceeds max_size ({} > {max_size})

Error message

ms365: downloaded file exceeds max_size ({} > {max_size})

What it means

Error "ms365: downloaded file exceeds max_size ({} > {max_size})" thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-tools/src/microsoft365/graph_client.rs:358

    if !resp.status().is_success() {
        let status = resp.status();
        let body = resp.text().await.unwrap_or_default();
        let code = extract_graph_error_code(&body).unwrap_or_else(|| "unknown".to_string());
        ::zeroclaw_log::record!(
            DEBUG,
            ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Note)
                .with_attrs(::serde_json::json!({"body": body})),
            "ms365: onedrive_download raw error body"
        );
        anyhow::bail!("ms365: onedrive_download failed ({status}, code={code})");
    }

    let bytes = resp
        .bytes()
        .await
        .context("ms365: failed to read download body")?;
    if bytes.len() > max_size {
        anyhow::bail!(
            "ms365: downloaded file exceeds max_size ({} > {max_size})",
            bytes.len()
        );
    }

    Ok(bytes.to_vec())
}

/// Search SharePoint for documents matching a query.
pub async fn sharepoint_search(
    client: &reqwest::Client,
    token: &str,
    query: &str,
    top: u32,
) -> anyhow::Result<serde_json::Value> {
    let url = format!("{GRAPH_BASE}/search/query");

    let payload = serde_json::json!({

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Increase max_size for the download or fetch a smaller file.

When it happens

Trigger: Thrown at crates/zeroclaw-tools/src/microsoft365/graph_client.rs:358 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/5067f1a4f2a0d417. Report an issue: GitHub.