Skip to content

Commit 8536956

Browse files
authored
Merge pull request #1988 from apiraino/log-error-on-zulip-send-fail
Log Zulip body reply when it fails
2 parents 19a277f + c622edd commit 8536956

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/handlers/notify_zulip.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,18 @@ pub(super) async fn handle_input<'a>(
218218
let msg = msg.replace("{title}", &event.issue.title);
219219
let msg = replace_team_to_be_nominated(&event.issue.labels, msg);
220220

221-
crate::zulip::MessageApiRequest {
221+
let resp = crate::zulip::MessageApiRequest {
222222
recipient,
223223
content: &msg,
224224
}
225225
.send(&ctx.github.raw())
226226
.await?;
227+
228+
let status = resp.status();
229+
let body = resp.text().await?;
230+
if !status.is_success() {
231+
log::error!("Failed to send notification to Zulip {}", body);
232+
}
227233
}
228234
}
229235
}

0 commit comments

Comments
 (0)