summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/org
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-01-13 21:14:48 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-01-14 10:14:48 +0800
commit27fcf8d30a8c8dda281739c84af4033c93d96faf (patch)
tree83c4c03b76539fc1907977e6ef8f32a08846a78d /routers/api/v1/org
parent87ad4961f62c24cf75377f3055e9769e269c80d9 (diff)
downloadgitea-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.go6
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)