Fix sentry http request info

Add async bot running with semaphore
This commit is contained in:
2026-06-10 17:50:24 +00:00
parent efb35d5a8a
commit a2d898c07d
7 changed files with 66 additions and 17 deletions
+12 -2
View File
@@ -1,6 +1,6 @@
use anyhow::anyhow;
use axum::response::IntoResponse;
use reqwest::StatusCode;
use tracing::error;
#[derive(thiserror::Error, Debug)]
pub enum AppError {
@@ -22,6 +22,9 @@ pub enum AppError {
#[error("WebHook have bad action")]
InvalidActionErr,
#[error("Channel full")]
ChannelFullErr,
#[error(transparent)]
BadJsonStructErr(#[from] serde_json::Error),
@@ -55,8 +58,15 @@ impl IntoResponse for AppError {
StatusCode::UNAUTHORIZED,
"WebHook sig header is invalid".to_string(),
),
AppError::ChannelFullErr => {
sentry_anyhow::capture_anyhow(&anyhow!("Max concurrent tasks reached"));
(
StatusCode::SERVICE_UNAVAILABLE,
"Max concurrent tasks reached".to_string(),
)
}
AppError::Other(err) => {
error!(%err, "Internal server error");
sentry_anyhow::capture_anyhow(&err);
(
StatusCode::INTERNAL_SERVER_ERROR,
"Internal server error".to_string(),