refactor(server): use httperror.NewError instead of struct [EE-6189] (#10398)

This commit is contained in:
Chaim Lev-Ari
2023-10-05 11:26:24 +03:00
committed by GitHub
parent da346cba60
commit 95f3cf6e5b
26 changed files with 39 additions and 35 deletions

View File

@@ -272,7 +272,7 @@ func (handler *Handler) createComposeStackFromGitRepository(w http.ResponseWrite
return httperror.InternalServerError("Unable to check for webhook ID collision", err)
}
if !isUnique {
return &httperror.HandlerError{StatusCode: http.StatusConflict, Message: fmt.Sprintf("Webhook ID: %s already exists", payload.AutoUpdate.Webhook), Err: stackutils.ErrWebhookIDAlreadyExists}
return httperror.Conflict(fmt.Sprintf("Webhook ID: %s already exists", payload.AutoUpdate.Webhook), stackutils.ErrWebhookIDAlreadyExists)
}
}