diff options
author | Corey Hulen <corey@hulen.com> | 2016-01-20 15:14:31 -0600 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-01-20 15:14:31 -0600 |
commit | 9f526555df64885be27e38e588c23332d80cd208 (patch) | |
tree | 80f5bcefbf4a481d6c841ff9ae333500ed143d88 /api | |
parent | d703d09063538fb91baa5a21b1001216c43d848a (diff) | |
parent | d74e2f3e1146efd80d4eeee36cf5c53e68b31fcc (diff) | |
download | chat-9f526555df64885be27e38e588c23332d80cd208.tar.gz chat-9f526555df64885be27e38e588c23332d80cd208.tar.bz2 chat-9f526555df64885be27e38e588c23332d80cd208.zip |
Merge pull request #1934 from mattermost/PLT-7-server-db
PLT-7-server-db
Diffstat (limited to 'api')
-rw-r--r-- | api/admin.go | 2 | ||||
-rw-r--r-- | api/api_test.go | 1 | ||||
-rw-r--r-- | api/context.go | 3 |
3 files changed, 4 insertions, 2 deletions
diff --git a/api/admin.go b/api/admin.go index 61741b445..72a95ba6a 100644 --- a/api/admin.go +++ b/api/admin.go @@ -41,7 +41,7 @@ func getLogs(c *Context, w http.ResponseWriter, r *http.Request) { file, err := os.Open(utils.GetLogFileLocation(utils.Cfg.LogSettings.FileLocation)) if err != nil { - c.Err = model.NewAppError("getLogs", c.T("api.admin.file_read_error"), err.Error()) + c.Err = model.NewLocAppError("getLogs", "api.admin.file_read_error", nil, err.Error()) } defer file.Close() diff --git a/api/api_test.go b/api/api_test.go index 2ef4e196d..4d7192e4b 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -14,6 +14,7 @@ var Client *model.Client func Setup() { if Srv == nil { utils.LoadConfig("config.json") + utils.InitTranslations() utils.Cfg.TeamSettings.MaxUsersPerTeam = 50 NewServer() StartServer() diff --git a/api/context.go b/api/context.go index b6ffb1a29..a3311a971 100644 --- a/api/context.go +++ b/api/context.go @@ -206,6 +206,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } if c.Err != nil { + c.Err.Translate(c.T) c.Err.RequestId = c.RequestId c.LogError(c.Err) c.Err.Where = r.URL.Path @@ -373,7 +374,7 @@ func (c *Context) RemoveSessionCookie(w http.ResponseWriter, r *http.Request) { } func (c *Context) SetInvalidParam(where string, name string) { - c.Err = model.NewAppError(where, "Invalid "+name+" parameter", "") + c.Err = model.NewLocAppError(where, "api.context.invalid_param", map[string]interface{}{"Name": name}, "") c.Err.StatusCode = http.StatusBadRequest } |