mirror of
https://github.com/Syfaro/fuzzysearch.git
synced 2024-11-10 17:02:38 +00:00
Ignore JSON deserialization errors.
This commit is contained in:
parent
54d18020a9
commit
c9a6706d5c
@ -75,7 +75,7 @@ async fn load_submission(
|
|||||||
) -> anyhow::Result<Option<(WeasylSubmission, serde_json::Value)>> {
|
) -> anyhow::Result<Option<(WeasylSubmission, serde_json::Value)>> {
|
||||||
println!("Loading submission {}", id);
|
println!("Loading submission {}", id);
|
||||||
|
|
||||||
let body: serde_json::Value = client
|
let body: Result<serde_json::Value, _> = client
|
||||||
.get(&format!(
|
.get(&format!(
|
||||||
"https://www.weasyl.com/api/submissions/{}/view",
|
"https://www.weasyl.com/api/submissions/{}/view",
|
||||||
id
|
id
|
||||||
@ -84,7 +84,12 @@ async fn load_submission(
|
|||||||
.send()
|
.send()
|
||||||
.await?
|
.await?
|
||||||
.json()
|
.json()
|
||||||
.await?;
|
.await;
|
||||||
|
|
||||||
|
let body = match body {
|
||||||
|
Err(_err) => return Ok(None),
|
||||||
|
Ok(body) => body,
|
||||||
|
};
|
||||||
|
|
||||||
let data: WeasylResponse<WeasylSubmission> = serde_json::from_value(body.clone())?;
|
let data: WeasylResponse<WeasylSubmission> = serde_json::from_value(body.clone())?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user