Skip to content

Commit c756ba8

Browse files
committed
Always reply with a 200 to Zulip webhook for now
1 parent 33e42a0 commit c756ba8

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/zulip.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::handlers::Context;
1212
use crate::handlers::docs_update::docs_update;
1313
use crate::handlers::pr_tracking::get_assigned_prs;
1414
use crate::handlers::project_goals::{self, ping_project_goals_owners};
15-
use crate::utils::{AppError, pluralize};
15+
use crate::utils::pluralize;
1616
use crate::zulip::api::{MessageApiResponse, Recipient};
1717
use crate::zulip::client::ZulipClient;
1818
use crate::zulip::commands::{
@@ -107,7 +107,19 @@ pub async fn webhook(
107107
})
108108
.into_response(),
109109
Ok(Some(content)) => Json(Response { content }).into_response(),
110-
Err(e) => AppError::from(e).into_response(),
110+
Err(err) => {
111+
// We are mixing network errors and "logic" error (like clap errors)
112+
// so don't return a 500. Long term we should decouple those.
113+
114+
// Log the full error
115+
tracing::error!(?err);
116+
117+
// Reply with a 200 and reply only with outermost error
118+
Json(Response {
119+
content: err.to_string(),
120+
})
121+
.into_response()
122+
}
111123
}
112124
}
113125

0 commit comments

Comments
 (0)