File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,8 @@ pub async fn webhook(
172172 return ( StatusCode :: BAD_REQUEST , "Payload must be UTF-8" ) . into_response ( ) ;
173173 } ;
174174
175+ tracing:: info!( ?event, ?payload) ;
176+
175177 match process_payload ( event, payload, & ctx) . await {
176178 Ok ( true ) => ( "processed request" , ) . into_response ( ) ,
177179 Ok ( false ) => ( "ignored request" , ) . into_response ( ) ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use crate::handlers::Context;
1212use crate :: handlers:: docs_update:: docs_update;
1313use crate :: handlers:: pr_tracking:: get_assigned_prs;
1414use crate :: handlers:: project_goals:: { self , ping_project_goals_owners} ;
15- use crate :: utils:: { AppError , pluralize} ;
15+ use crate :: utils:: pluralize;
1616use crate :: zulip:: api:: { MessageApiResponse , Recipient } ;
1717use crate :: zulip:: client:: ZulipClient ;
1818use 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
You can’t perform that action at this time.
0 commit comments