[MM-31360] downgrade error logs which doesn't break the flow (#16612)
* downgrade error logs which doesn't break the flow * reflect revivew comments
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c1dd23a3c8
Коммит
f9c0c1072f
@@ -212,7 +212,7 @@ func updateChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if oldChannelDisplayName != channel.DisplayName {
|
||||
if err := c.App.PostUpdateChannelDisplayNameMessage(c.App.Session().UserId, channel, oldChannelDisplayName, channel.DisplayName); err != nil {
|
||||
mlog.Error(err.Error())
|
||||
mlog.Warn("Error while posting channel display name message", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@ func getSupportedTimezones(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
b, err := json.Marshal(supportedTimezones)
|
||||
if err != nil {
|
||||
c.Log.Warn("Unable to marshal JSON in timezones.", mlog.Err(err))
|
||||
c.Logger.Warn("Unable to marshal JSON in timezones.", mlog.Err(err))
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
|
||||
10
api4/user.go
10
api4/user.go
@@ -167,7 +167,7 @@ func createUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
if ruser != nil {
|
||||
err = c.App.CheckAndSendUserLimitWarningEmails()
|
||||
if err != nil {
|
||||
mlog.Error(err.Error())
|
||||
c.LogErrorByCode(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1358,7 +1358,7 @@ func updateUserActive(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
if isSelfDeactive {
|
||||
c.App.Srv().Go(func() {
|
||||
if err = c.App.Srv().EmailService.SendDeactivateAccountEmail(user.Email, user.Locale, c.App.GetSiteURL()); err != nil {
|
||||
mlog.Error(err.Error())
|
||||
c.LogErrorByCode(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1823,7 +1823,7 @@ func loginCWS(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
user, err := c.App.AuthenticateUserForLogin("", loginID, "", "", token, false)
|
||||
if err != nil {
|
||||
c.LogAuditWithUserId("", "failure - login_id="+loginID)
|
||||
mlog.Error("CWS authentication error", mlog.Err(err))
|
||||
c.LogErrorByCode(err)
|
||||
http.Redirect(w, r, *c.App.Config().ServiceSettings.SiteURL, 302)
|
||||
return
|
||||
}
|
||||
@@ -1831,7 +1831,7 @@ func loginCWS(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
c.LogAuditWithUserId(user.Id, "authenticated")
|
||||
err = c.App.DoLogin(w, r, user, "", false, false, false)
|
||||
if err != nil {
|
||||
mlog.Error("CWS login error", mlog.Err(err))
|
||||
c.LogErrorByCode(err)
|
||||
http.Redirect(w, r, *c.App.Config().ServiceSettings.SiteURL, 302)
|
||||
return
|
||||
}
|
||||
@@ -2110,7 +2110,7 @@ func sendVerificationEmail(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if err = c.App.SendEmailVerification(user, user.Email, redirect); err != nil {
|
||||
// Don't want to leak whether the email is valid or not
|
||||
mlog.Error(err.Error())
|
||||
c.LogErrorByCode(err)
|
||||
ReturnStatusOK(w)
|
||||
return
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user