diff options
author | metamuffin <metamuffin@disroot.org> | 2025-04-27 15:38:01 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-04-27 15:38:01 +0200 |
commit | 2f64fb74715f42a6efccf22f6573547423fdddbb (patch) | |
tree | 1395c6692579e9f202a71949fcc1ac3f8ac01b82 /import/src/wikidata.rs | |
parent | 0039f102d03cd930a7694bc3a8bd90916e2dacf8 (diff) | |
download | jellything-2f64fb74715f42a6efccf22f6573547423fdddbb.tar jellything-2f64fb74715f42a6efccf22f6573547423fdddbb.tar.bz2 jellything-2f64fb74715f42a6efccf22f6573547423fdddbb.tar.zst |
context on api errors
Diffstat (limited to 'import/src/wikidata.rs')
-rw-r--r-- | import/src/wikidata.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/import/src/wikidata.rs b/import/src/wikidata.rs index 267899f..48a46be 100644 --- a/import/src/wikidata.rs +++ b/import/src/wikidata.rs @@ -5,7 +5,7 @@ */ use crate::USER_AGENT; -use anyhow::{bail, Result}; +use anyhow::{bail, Context, Result}; use jellybase::cache::async_cache_memory; use log::info; use reqwest::{ @@ -113,8 +113,9 @@ impl Wikidata { Ok(resp) }) - .await?; + .await + .context("wikidata entity")?; - Ok(serde_json::from_str(&json)?) + Ok(serde_json::from_str(&json).context("parse wikidata entity")?) } } |