add: provide more information on psql and redis connection errors

This commit is contained in:
trisua 2025-05-28 13:41:19 -04:00
parent 013bc0b45f
commit 22ae479bd7
4 changed files with 23 additions and 9 deletions

View file

@ -119,12 +119,13 @@ pub async fn proxy_request(
}
// ...
let res = reqwest::get(format!("https://ws.audioscrobbler.com/2.0/{out}"))
.await
.unwrap()
.text()
.await
.unwrap();
let res = match reqwest::get(format!("https://ws.audioscrobbler.com/2.0/{out}")).await {
Ok(c) => c,
Err(e) => return Json(Error::MiscError(e.to_string()).into()),
}
.text()
.await
.unwrap();
Json(ApiReturn {
ok: true,