diff options
Diffstat (limited to 'models/webhook.go')
-rw-r--r-- | models/webhook.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/models/webhook.go b/models/webhook.go index c9c3c21a46..8f5c561939 100644 --- a/models/webhook.go +++ b/models/webhook.go @@ -258,8 +258,10 @@ func deleteWebhook(bean *Webhook) (err error) { return err } - if _, err = sess.Delete(bean); err != nil { + if count, err := sess.Delete(bean); err != nil { return err + } else if count == 0 { + return ErrWebhookNotExist{ID: bean.ID} } else if _, err = sess.Delete(&HookTask{HookID: bean.ID}); err != nil { return err } |