mirror of
https://github.com/harness/drone.git
synced 2025-05-09 00:22:18 +08:00
Merge pull request #244 from marcusramberg/parse_hook
Expose error message when github hook payload cannot be parsed
This commit is contained in:
commit
3b83222bf9
@ -47,7 +47,7 @@ func (h *HookHandler) HookGithub(w http.ResponseWriter, r *http.Request) error {
|
|||||||
// parse the github Hook payload
|
// parse the github Hook payload
|
||||||
hook, err := github.ParseHook([]byte(payload))
|
hook, err := github.ParseHook([]byte(payload))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println("could not parse hook")
|
println("could not parse hook:", err.Error())
|
||||||
return RenderText(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
|
return RenderText(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user