feat(be/settings): add api for reporting client error
This commit is contained in:
parent
4fd9bd9c33
commit
7577fb0ace
5 changed files with 67 additions and 2 deletions
|
@ -77,3 +77,20 @@ func validateClientCfg(cfg *sitestore.ClientConfig) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ClientErrorReport struct {
|
||||
Report string `json:"report"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
func (h *SettingsSvc) ReportError(c *gin.Context) {
|
||||
var err error
|
||||
req := &ClientErrorReport{}
|
||||
if err = c.ShouldBindJSON(&req); err != nil {
|
||||
c.JSON(q.ErrResp(c, 400, err))
|
||||
return
|
||||
}
|
||||
|
||||
h.deps.Log().Errorf("version:%s,error:%s", req.Version, req.Report)
|
||||
c.JSON(q.Resp(200))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue