@@ -147,6 +147,7 @@ impl N8nClient {
147147 events = ?trigger. events,
148148 owner = %trigger. owner,
149149 repository = %trigger. repository,
150+ has_webhook_secret = trigger. webhook_secret. is_some( ) ,
150151 "Found GitHub trigger"
151152 ) ;
152153 triggers. push ( trigger) ;
@@ -215,12 +216,15 @@ impl N8nClient {
215216 /// The `raw_body` parameter is the exact raw request body from the source
216217 /// (Slack, Jira, etc.). This is forwarded as-is (not re-serialized) to
217218 /// preserve the exact bytes for signature/authentication verification by n8n.
219+ ///
220+ /// Returns the HTTP status code from n8n's response on success, or an error
221+ /// if the request couldn't be sent at all (connection failure, DNS, etc.).
218222 pub async fn forward_event (
219223 & self ,
220224 webhook_url : & str ,
221225 raw_body : & str ,
222226 headers : & HeaderMap ,
223- ) -> Result < ( ) , N8nClientError > {
227+ ) -> Result < u16 , N8nClientError > {
224228 debug ! (
225229 webhook_url = %webhook_url,
226230 forwarded_headers = headers. len( ) ,
@@ -249,16 +253,18 @@ impl N8nClient {
249253 N8nClientError :: RequestFailed ( e. to_string ( ) )
250254 } ) ?;
251255
252- if !response. status ( ) . is_success ( ) {
253- let status = response. status ( ) ;
256+ let status = response. status ( ) ;
257+ let status_code = status. as_u16 ( ) ;
258+
259+ if !status. is_success ( ) {
254260 warn ! (
255261 status = %status,
256262 webhook_url = %webhook_url,
257263 "Webhook returned non-success status"
258264 ) ;
259265 }
260266
261- Ok ( ( ) )
267+ Ok ( status_code )
262268 }
263269}
264270
0 commit comments