Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle panics that percolate up to the graceful module #11291

Merged
merged 6 commits into from
May 15, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Handle panic in webhook.Deliver
Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath committed May 4, 2020
commit 15eefef32daee0b2c04a4e73cccc9a49a5147935
8 changes: 8 additions & 0 deletions modules/webhook/deliver.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ import (

// Deliver deliver hook task
func Deliver(t *models.HookTask) error {
defer func() {
err := recover()
if err == nil {
return
}
// There was a panic whilst delivering a hook...
log.Error("PANIC whilst trying to deliver webhook[%d] for repo[%d] to %s Panic: %v\nStacktrace: %s", t.ID, t.RepoID, t.URL, err, log.Stack(2))
}()
t.IsDelivered = true

var req *http.Request
Expand Down