Skip to content

Commit

Permalink
debug webhook issue
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Nov 4, 2024
1 parent e59a309 commit fbc782b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ pub async fn log_external(
None => return Err(Box::new(LogError {})),
};

println!("here");

let json = ExternalLog {
embeds: vec![ExternalLogEmbed {
title: title,
Expand All @@ -56,12 +58,14 @@ pub async fn log_external(
username: "[cmdb]".to_string(),
};

let _ = reqwest::Client::new()
match reqwest::Client::new()
.post(&logging_config.webhook)
.body(serde_json::to_string(&json)?)
.header("Content-Type", "application/json")
.send()
.await?;

Ok(())
.await
{
Ok(_) => Ok(()),
Err(err) => panic!("{err:?}"),
}
}

0 comments on commit fbc782b

Please sign in to comment.