aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/org/hook.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/org/hook.go')
-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)