summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/app.go2
-rw-r--r--app/auto_channels.go1
-rw-r--r--app/auto_users.go2
-rw-r--r--app/plugin.go1
-rw-r--r--app/plugin/ldapextras/plugin.go2
-rw-r--r--app/team_test.go2
6 files changed, 2 insertions, 8 deletions
diff --git a/app/app.go b/app/app.go
index 4813926e2..8aa894b9b 100644
--- a/app/app.go
+++ b/app/app.go
@@ -101,6 +101,7 @@ func New(options ...Option) *App {
if utils.T == nil {
utils.TranslationsPreInit()
}
+ model.AppErrorInit(utils.T)
utils.LoadGlobalConfig(app.configFile)
utils.InitTranslations(utils.Cfg.LocalizationSettings)
@@ -472,7 +473,6 @@ func (a *App) HTTPClient(trustURLs bool) *http.Client {
func (a *App) Handle404(w http.ResponseWriter, r *http.Request) {
err := model.NewAppError("Handle404", "api.context.404.app_error", nil, "", http.StatusNotFound)
- err.Translate(utils.T)
l4g.Debug("%v: code=404 ip=%v", r.URL.Path, utils.GetIpAddress(r))
diff --git a/app/auto_channels.go b/app/auto_channels.go
index bb67e1aa8..78b500961 100644
--- a/app/auto_channels.go
+++ b/app/auto_channels.go
@@ -50,7 +50,6 @@ func (cfg *AutoChannelCreator) createRandomChannel() (*model.Channel, bool) {
println(cfg.client.GetTeamRoute())
result, err := cfg.client.CreateChannel(channel)
if err != nil {
- err.Translate(utils.T)
println(err.Error())
println(err.DetailedError)
return nil, false
diff --git a/app/auto_users.go b/app/auto_users.go
index 36b5b7279..8ed6767ad 100644
--- a/app/auto_users.go
+++ b/app/auto_users.go
@@ -75,7 +75,6 @@ func (cfg *AutoUserCreator) createRandomUser() (*model.User, bool) {
result, err := cfg.client.CreateUserWithInvite(user, "", "", cfg.team.InviteId)
if err != nil {
- err.Translate(utils.T)
l4g.Error(err.Error())
return nil, false
}
@@ -84,7 +83,6 @@ func (cfg *AutoUserCreator) createRandomUser() (*model.User, bool) {
status := &model.Status{UserId: ruser.Id, Status: model.STATUS_ONLINE, Manual: false, LastActivityAt: model.GetMillis(), ActiveChannel: ""}
if result := <-cfg.app.Srv.Store.Status().SaveOrUpdate(status); result.Err != nil {
- result.Err.Translate(utils.T)
l4g.Error(result.Err.Error())
return nil, false
}
diff --git a/app/plugin.go b/app/plugin.go
index 9083f4785..189ca9b09 100644
--- a/app/plugin.go
+++ b/app/plugin.go
@@ -428,7 +428,6 @@ func (a *App) InitPlugins(pluginPath, webappPath string, supervisorOverride plug
func (a *App) ServePluginRequest(w http.ResponseWriter, r *http.Request) {
if a.PluginEnv == nil || !*a.Config().PluginSettings.Enable {
err := model.NewAppError("ServePluginRequest", "app.plugin.disabled.app_error", nil, "Enable plugins to serve plugin requests", http.StatusNotImplemented)
- err.Translate(utils.T)
l4g.Error(err.Error())
w.WriteHeader(err.StatusCode)
w.Header().Set("Content-Type", "application/json")
diff --git a/app/plugin/ldapextras/plugin.go b/app/plugin/ldapextras/plugin.go
index 473ec6393..3af55c2ac 100644
--- a/app/plugin/ldapextras/plugin.go
+++ b/app/plugin/ldapextras/plugin.go
@@ -13,7 +13,6 @@ import (
"github.com/mattermost/mattermost-server/app/plugin"
"github.com/mattermost/mattermost-server/model"
- "github.com/mattermost/mattermost-server/utils"
)
type Plugin struct {
@@ -65,7 +64,6 @@ func (p *Plugin) handleGetAttributes(w http.ResponseWriter, r *http.Request) {
attributes, err := p.api.GetLdapUserAttributes(id, config.Attributes)
if err != nil {
- err.Translate(utils.T)
http.Error(w, fmt.Sprintf("Errored getting attributes: %v", err.Error()), http.StatusInternalServerError)
}
diff --git a/app/team_test.go b/app/team_test.go
index 10f33f50b..084558fb4 100644
--- a/app/team_test.go
+++ b/app/team_test.go
@@ -69,7 +69,7 @@ func TestCreateTeamWithUser(t *testing.T) {
t.Log(err.Message)
t.Fatal("Should not create a team with user when user has set email without domain")
} else {
- if err.Message != "model.team.is_valid.email.app_error" {
+ if err.Id != "model.team.is_valid.email.app_error" {
t.Log(err)
t.Fatal("Invalid error message")
}