diff --git a/src/main.rs b/src/main.rs index c82f512..a033d72 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,7 +75,7 @@ async fn load_submission( ) -> anyhow::Result> { println!("Loading submission {}", id); - let body: serde_json::Value = client + let body: Result = client .get(&format!( "https://www.weasyl.com/api/submissions/{}/view", id @@ -84,7 +84,12 @@ async fn load_submission( .send() .await? .json() - .await?; + .await; + + let body = match body { + Err(_err) => return Ok(None), + Ok(body) => body, + }; let data: WeasylResponse = serde_json::from_value(body.clone())?;