Skip to content

Commit

Permalink
feat(telegram): log message which fails
Browse files Browse the repository at this point in the history
  • Loading branch information
alextes committed Feb 8, 2024
1 parent a0e2f82 commit 1776f9a
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/phoenix/telegram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,16 @@ pub async fn send_telegram_warning(message: &str) -> anyhow::Result<()> {
}
StatusCode::BAD_REQUEST => {
let body = response.text().await?;
Err(anyhow!("failed to send telegram warning: {}", body))
Err(anyhow!(
"failed to send telegram warning: {}, message: {}",
body,
message
))
}
status => Err(anyhow!(
"failed to send telegram warning, status: {:?}",
status
"failed to send telegram warning, status: {:?}, message: {}",
status,
message
)),
}
}
Expand Down Expand Up @@ -97,11 +102,16 @@ pub async fn send_telegram_alert(message: &str) -> anyhow::Result<()> {
}
StatusCode::BAD_REQUEST => {
let body = response.text().await?;
Err(anyhow!("failed to send telegram alert: {}", body))
Err(anyhow!(
"failed to send telegram alert: {}, message: {}",
body,
message
))
}
_ => Err(anyhow!(
"failed to send telegram alert, status: {:?}",
response.status()
"failed to send telegram alert, status: {:?}, message: {}",
response.status(),
message
)),
}
}

0 comments on commit 1776f9a

Please sign in to comment.