Skip to content

Commit

Permalink
+ set hook error catching
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Komrakov committed Sep 14, 2015
1 parent 740ebe8 commit 85431f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ func SetHook(w http.ResponseWriter, req *http.Request) {
url := config.Url + "/hooks"
hook := &github.Hook{Name: github.String("web"), Active: github.Bool(true), Events: config.Events, Config: map[string]interface {}{"url": url}}

client.Repositories.CreateHook(params["user"], params["repo"], hook)
_, _, err := client.Repositories.CreateHook(params["user"], params["repo"], hook)
if err != nil {
panic(err)
}

http.Redirect(w, req, "/repos/" + params["user"] + "/" + params["repo"], http.StatusTemporaryRedirect)
}
Expand Down

0 comments on commit 85431f4

Please sign in to comment.