Skip to content

Commit 6e18496

Browse files
committed
log at start of send_notification before potential errors
1 parent 9bd0cae commit 6e18496

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/api_remote.ml

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ module Slack : Api.Slack = struct
5555
(** `send_notification ctx msg` notifies `msg.channel` with the payload `msg`;
5656
uses web API with access token if available, or with webhook otherwise *)
5757
let send_notification ~(ctx : Context.t) ~(msg : Slack_t.post_message_req) =
58+
log#info "sending to %s" msg.channel;
5859
let build_error e = fmt_error "%s\nfailed to send Slack notification" e in
5960
let build_query_error url e = build_error @@ sprintf "error while querying %s: %s" url e in
6061
let secrets = Context.get_secrets_exn ctx in
@@ -68,7 +69,7 @@ module Slack : Api.Slack = struct
6869
| Some url ->
6970
let data = Slack_j.string_of_post_message_req msg in
7071
let body = `Raw ("application/json", data) in
71-
log#info "sending to %s : %s" msg.channel data;
72+
log#info "data: %s" data;
7273
( match%lwt http_request ~body ~headers `POST url with
7374
(* error detection in response: slack uses status codes for webhooks versus a 200 code w/ `error` field for web api *)
7475
| Ok s ->

0 commit comments

Comments
 (0)