gateway: handle skipped webhook
This commit is contained in:
parent
84879bf591
commit
58a77ad221
|
@ -174,6 +174,13 @@ func (h *webhooksHandler) handleWebhook(r *http.Request) (int, string, error) {
|
|||
if err != nil {
|
||||
return http.StatusBadRequest, "", errors.Wrapf(err, "failed to parse webhook")
|
||||
}
|
||||
// skip nil webhook data
|
||||
// TODO(sgotti) report the reason of the skip
|
||||
if webhookData == nil {
|
||||
h.log.Infof("skipping webhook")
|
||||
return 0, "", nil
|
||||
}
|
||||
|
||||
webhookData.ProjectID = projectID
|
||||
|
||||
// get project variables
|
||||
|
@ -223,6 +230,12 @@ func (h *webhooksHandler) handleWebhook(r *http.Request) (int, string, error) {
|
|||
if err != nil {
|
||||
return http.StatusBadRequest, "", errors.Wrapf(err, "failed to parse webhook")
|
||||
}
|
||||
// skip nil webhook data
|
||||
// TODO(sgotti) report the reason of the skip
|
||||
if webhookData == nil {
|
||||
h.log.Infof("skipping webhook")
|
||||
return 0, "", nil
|
||||
}
|
||||
|
||||
user, _, err := h.configstoreClient.GetUser(ctx, userID)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue