diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-01-13 21:14:48 -0500 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-01-14 10:14:48 +0800 |
commit | 27fcf8d30a8c8dda281739c84af4033c93d96faf (patch) | |
tree | 83c4c03b76539fc1907977e6ef8f32a08846a78d /routers/api/v1/org | |
parent | 87ad4961f62c24cf75377f3055e9769e269c80d9 (diff) | |
download | gitea-27fcf8d30a8c8dda281739c84af4033c93d96faf.tar.gz gitea-27fcf8d30a8c8dda281739c84af4033c93d96faf.zip |
Bug fixes for webhook API (#650)
Diffstat (limited to 'routers/api/v1/org')
-rw-r--r-- | routers/api/v1/org/hook.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/api/v1/org/hook.go b/routers/api/v1/org/hook.go index ebea13e56a..3a0b74ac21 100644 --- a/routers/api/v1/org/hook.go +++ b/routers/api/v1/org/hook.go @@ -58,7 +58,11 @@ func DeleteHook(ctx *context.APIContext) { org := ctx.Org.Organization hookID := ctx.ParamsInt64(":id") if err := models.DeleteWebhookByOrgID(org.ID, hookID); err != nil { - ctx.Error(500, "DeleteWebhookByOrgID", err) + if models.IsErrWebhookNotExist(err) { + ctx.Status(404) + } else { + ctx.Error(500, "DeleteWebhookByOrgID", err) + } return } ctx.Status(204) |