Migration of AuditStore to return plain errors (#14825)

Automatic Merge
Этот коммит содержится в:
Rodrigo Villablanca
2020-06-26 00:26:35 -04:00
коммит произвёл GitHub
родитель 98d72e51fe
Коммит 0118db9d23
12 изменённых файлов: 100 добавлений и 72 удалений

Просмотреть файл

@@ -65,7 +65,8 @@ func (c *Context) MakeAuditRecord(event string, initialStatus string) *audit.Rec
func (c *Context) LogAudit(extraInfo string) {
audit := &model.Audit{UserId: c.App.Session().UserId, IpAddress: c.App.IpAddress(), Action: c.App.Path(), ExtraInfo: extraInfo, SessionId: c.App.Session().Id}
if err := c.App.Srv().Store.Audit().Save(audit); err != nil {
c.LogError(err)
appErr := model.NewAppError("LogAudit", "app.audit.save.saving.app_error", nil, err.Error(), http.StatusInternalServerError)
c.LogError(appErr)
}
}
@@ -77,7 +78,8 @@ func (c *Context) LogAuditWithUserId(userId, extraInfo string) {
audit := &model.Audit{UserId: userId, IpAddress: c.App.IpAddress(), Action: c.App.Path(), ExtraInfo: extraInfo, SessionId: c.App.Session().Id}
if err := c.App.Srv().Store.Audit().Save(audit); err != nil {
c.LogError(err)
appErr := model.NewAppError("LogAuditWithUserId", "app.audit.save.saving.app_error", nil, err.Error(), http.StatusInternalServerError)
c.LogError(appErr)
}
}