print err when recording request
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"log"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
@@ -15,5 +17,8 @@ func recordUserMessage(c *gin.Context, db *gorm.DB, body []byte) {
|
|||||||
requestRecord := RequestRecord{
|
requestRecord := RequestRecord{
|
||||||
Body: bodyStr,
|
Body: bodyStr,
|
||||||
}
|
}
|
||||||
db.Create(&requestRecord)
|
err := db.Create(&requestRecord).Error
|
||||||
|
if err != nil {
|
||||||
|
log.Println("Error record request:", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user