Skip to content

Commit

Permalink
utils: better event error message
Browse files Browse the repository at this point in the history
  • Loading branch information
sewenthy committed May 24, 2024
1 parent ee6ac24 commit a6276b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ let validate_signature ?(version = "v0") ?signing_key ~headers body =
*)
let process_slack_notification (ctx : Context.t) headers body ~notification_handler =
match event_notification_of_string body with
| exception Yojson.Json_error e -> Lwt.return_error (sprintf "Invalid events notification: %s" e)
| Url_verification payload -> Lwt.return_ok payload.challenge
| Event_callback notification ->
match validate_signature ?signing_key:ctx.secrets.slack_signing_secret ~headers body with
Expand Down

0 comments on commit a6276b7

Please sign in to comment.