fix: 在 PullCodeHandler 和 BuildBotHandler 中添加错误日志记录,提升错误处理的可追溯性
This commit is contained in:
@@ -181,6 +181,7 @@ func PullCodeHandler(c *gin.Context) {
|
||||
err := util.GitPull()
|
||||
log.Println("拉取代码...")
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
@@ -197,6 +198,7 @@ func BuildBotHandler(c *gin.Context) {
|
||||
err := buildBot()
|
||||
log.Println("构建程序...")
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user