From 296a4f1977deec5335579501c1046efb6dcb258d Mon Sep 17 00:00:00 2001 From: Elena Grahovac Date: Wed, 20 Dec 2017 12:12:38 +0100 Subject: [PATCH] Log the exact error in case of 'error setting commit status' --- server/build.go | 4 ++-- server/hook.go | 2 +- server/rpc.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/build.go b/server/build.go index 245467edc..43d391d81 100644 --- a/server/build.go +++ b/server/build.go @@ -301,7 +301,7 @@ func PostApproval(c *gin.Context) { uri := fmt.Sprintf("%s/%s/%d", httputil.GetURL(c.Request), repo.FullName, build.Number) err = remote_.Status(user, repo, build, uri) if err != nil { - logrus.Errorf("error setting commit status for %s/%d", repo.FullName, build.Number) + logrus.Errorf("error setting commit status for %s/%d: %v", repo.FullName, build.Number, err) } }() @@ -427,7 +427,7 @@ func PostDecline(c *gin.Context) { uri := fmt.Sprintf("%s/%s/%d", httputil.GetURL(c.Request), repo.FullName, build.Number) err = remote_.Status(user, repo, build, uri) if err != nil { - logrus.Errorf("error setting commit status for %s/%d", repo.FullName, build.Number) + logrus.Errorf("error setting commit status for %s/%d: %v", repo.FullName, build.Number, err) } c.JSON(200, build) diff --git a/server/hook.go b/server/hook.go index 0a8d0dec9..d213b6193 100644 --- a/server/hook.go +++ b/server/hook.go @@ -247,7 +247,7 @@ func PostHook(c *gin.Context) { uri := fmt.Sprintf("%s/%s/%d", httputil.GetURL(c.Request), repo.FullName, build.Number) err = remote_.Status(user, repo, build, uri) if err != nil { - logrus.Errorf("error setting commit status for %s/%d", repo.FullName, build.Number) + logrus.Errorf("error setting commit status for %s/%d: %v", repo.FullName, build.Number, err) } }() diff --git a/server/rpc.go b/server/rpc.go index ba747e95b..36d961566 100644 --- a/server/rpc.go +++ b/server/rpc.go @@ -428,7 +428,7 @@ func (s *RPC) Done(c context.Context, id string, state rpc.State) error { uri := fmt.Sprintf("%s/%s/%d", s.host, repo.FullName, build.Number) err = s.remote.Status(user, repo, build, uri) if err != nil { - logrus.Errorf("error setting commit status for %s/%d", repo.FullName, build.Number) + logrus.Errorf("error setting commit status for %s/%d: %v", repo.FullName, build.Number, err) } } }