[MM-31359] remove duplicated error logs (#16583)

* remove duplicated error logs

* reflect review comments

* add context

* add error details
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2020-12-29 09:48:36 +03:00
коммит произвёл GitHub
родитель 727a158e9a
Коммит 40e16ba07f
19 изменённых файлов: 16 добавлений и 47 удалений

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

@@ -371,7 +371,6 @@ func (a *App) notifyAdminsOfWarnMetricStatus(warnMetricId string, isE0Edition bo
channel, appErr := a.GetOrCreateDirectChannel(bot.UserId, sysAdmin.Id)
if appErr != nil {
mlog.Error("Cannot create channel for system bot notification!", mlog.String("Admin Id", sysAdmin.Id))
return appErr
}
@@ -484,7 +483,6 @@ func (a *App) NotifyAndSetWarnMetricAck(warnMetricId string, sender *model.User,
bodyPage.Props["Title"] = warnMetricDisplayTexts.EmailBody
if err := mailservice.SendMailUsingConfig(model.MM_SUPPORT_ADVISOR_ADDRESS, subject, bodyPage.Render(), a.Config(), false, sender.Email); err != nil {
mlog.Error("Error while sending email", mlog.String("destination email", model.MM_SUPPORT_ADVISOR_ADDRESS), mlog.Err(err))
return model.NewAppError("NotifyAndSetWarnMetricAck", "api.email.send_warn_metric_ack.failure.app_error", map[string]interface{}{"Error": err.Error()}, "", http.StatusInternalServerError)
}
}
@@ -526,7 +524,6 @@ func (a *App) setWarnMetricsStatusForId(warnMetricId string, status string) *mod
Name: warnMetricId,
Value: status,
}); err != nil {
mlog.Error("Unable to write to database.", mlog.Err(err))
return model.NewAppError("setWarnMetricsStatusForId", "app.system.warn_metric.store.app_error", map[string]interface{}{"WarnMetricName": warnMetricId}, err.Error(), http.StatusInternalServerError)
}
return nil
@@ -544,7 +541,6 @@ func (a *App) RequestLicenseAndAckWarnMetric(warnMetricId string, isBot bool) *m
registeredUsersCount, err := a.Srv().Store.User().Count(model.UserCountOptions{})
if err != nil {
mlog.Error("Error retrieving the number of registered users", mlog.Err(err))
return model.NewAppError("RequestLicenseAndAckWarnMetric", "api.license.request_trial_license.fail_get_user_count.app_error", nil, err.Error(), http.StatusBadRequest)
}