summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-26 16:42:20 -0400
committerUnknwon <u@gogs.io>2016-03-26 16:42:20 -0400
commitac53bb593d12bac3b44380defe73d13e728cd142 (patch)
tree8907912c671463e5c167a021ded4fc52d1d0e15c /modules
parentdd36c431ece67e47beb0e64070015808627538e5 (diff)
downloadgitea-ac53bb593d12bac3b44380defe73d13e728cd142.tar.gz
gitea-ac53bb593d12bac3b44380defe73d13e728cd142.zip
#2878 print error of JSON unmarshal and always returns a valid object
Diffstat (limited to 'modules')
-rw-r--r--modules/template/template.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/template/template.go b/modules/template/template.go
index c5379e188f..7c35449737 100644
--- a/modules/template/template.go
+++ b/modules/template/template.go
@@ -18,6 +18,7 @@ import (
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
+ "github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/markdown"
"github.com/gogits/gogs/modules/setting"
)
@@ -255,7 +256,7 @@ func ActionIcon(opType int) string {
func ActionContent2Commits(act Actioner) *models.PushCommits {
push := models.NewPushCommits()
if err := json.Unmarshal([]byte(act.GetContent()), push); err != nil {
- return nil
+ log.Error(4, "json.Unmarshal:\n%s\nERROR: %v", act.GetContent(), err)
}
return push
}