From 39c4cf2d2a35e6afa1020a622879724d5798cb9d Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 13 Dec 2023 22:46:43 +0300 Subject: [PATCH] debug-get-author --- src/data.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/data.rs b/src/data.rs index 5d85e40..0135744 100644 --- a/src/data.rs +++ b/src/data.rs @@ -33,7 +33,15 @@ async fn get_author_id(user: &str) -> Result> { .send() .await?; - if response.status().is_success() { + + // Print the entire response body + let response_text = response.text().await?; + Err(Box::new(std::io::Error::new( + std::io::ErrorKind::Other, + format!("Server Response: {}", response_text) + ))) + + /* if response.status().is_success() { let r: HashMap = response.json().await?; let author_id = r .get("data") @@ -59,6 +67,7 @@ async fn get_author_id(user: &str) -> Result> { format!("Request failed with status: {}", response.status()), ))) } + */ }