SystemStore migration to return plain errors (#14835)

* SystemStore migration to return plain errors

* Fix nilness

* Fix translations

* Fix merge

* Fix layers

* Fix merge errors

* Lint: remove unnecessary use of sprint

* Fix merge errors

* Fix i18n

Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Этот коммит содержится в:
Rodrigo Villablanca
2020-08-13 11:02:57 -04:00
коммит произвёл GitHub
родитель e8d431ee7c
Коммит 20e44399c7
18 изменённых файлов: 252 добавлений и 173 удалений

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

@@ -31,8 +31,8 @@ func (s *Server) LoadLicense() {
}
licenseId := ""
props, err := s.Store.System().Get()
if err == nil {
props, nErr := s.Store.System().Get()
if nErr == nil {
licenseId = props[model.SYSTEM_ACTIVE_LICENSE_ID]
}
@@ -41,7 +41,7 @@ func (s *Server) LoadLicense() {
license, licenseBytes := utils.GetAndValidateLicenseFileFromDisk(*s.Config().ServiceSettings.LicenseFileLocation)
if license != nil {
if _, err = s.SaveLicense(licenseBytes); err != nil {
if _, err := s.SaveLicense(licenseBytes); err != nil {
mlog.Info("Failed to save license key loaded from disk.", mlog.Err(err))
} else {
licenseId = license.Id
@@ -184,7 +184,7 @@ func (s *Server) RemoveLicense() *model.AppError {
sysVar.Value = ""
if err := s.Store.System().SaveOrUpdate(sysVar); err != nil {
return err
return model.NewAppError("RemoveLicense", "app.system.save.app_error", nil, err.Error(), http.StatusInternalServerError)
}
s.SetLicense(nil)