diff --git a/src/api.rs b/src/api.rs index ac09579..b8c130a 100644 --- a/src/api.rs +++ b/src/api.rs @@ -60,10 +60,17 @@ pub async fn post_upcoming_colles( .header("Authorization", format!("Bearer {api_token}")) .send() .await?; + + let status = response.status(); + // Check if the response is successful - if !response.status().is_success() { - eprintln!("Failed to post upcoming colles: HTTP {}", response.status(),); - eprint!("Response: {:?}", response.text().await?); + if !status.is_success() { + let body = response.text().await?; + eprintln!("❌ Failed to post colle"); + eprintln!(" → URL: {url}"); + eprintln!(" → Status: {status}"); + eprintln!(" → Request body: {colles_json}"); + eprintln!(" → Response body: {body}"); return Err("Failed to post upcoming colles".into()); }