summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-01-27 10:56:15 -0500
committer=Corey Hulen <corey@hulen.com>2016-01-27 10:56:15 -0500
commitdc4b71bba2cad5e85e86cc6ecb743bea84f9ccc8 (patch)
tree61703583db1a1bdf18c1f4b410950c9d701abe2d /api
parentb7606da40f5403896dfbf930837530b4b22abacd (diff)
downloadchat-dc4b71bba2cad5e85e86cc6ecb743bea84f9ccc8.tar.gz
chat-dc4b71bba2cad5e85e86cc6ecb743bea84f9ccc8.tar.bz2
chat-dc4b71bba2cad5e85e86cc6ecb743bea84f9ccc8.zip
PLT-7 Removing AppError ctor
Diffstat (limited to 'api')
-rw-r--r--api/admin.go4
-rw-r--r--api/license.go4
-rw-r--r--api/user.go2
3 files changed, 6 insertions, 4 deletions
diff --git a/api/admin.go b/api/admin.go
index b19772fdf..0ea6341e2 100644
--- a/api/admin.go
+++ b/api/admin.go
@@ -73,7 +73,9 @@ func logClient(c *Context, w http.ResponseWriter, r *http.Request) {
}
if lvl == "ERROR" {
- err := model.NewAppError("client", msg, "")
+ err := &model.AppError{}
+ err.Message = msg
+ err.Where = "client"
c.LogError(err)
}
diff --git a/api/license.go b/api/license.go
index 5c602a68e..5c97637e7 100644
--- a/api/license.go
+++ b/api/license.go
@@ -65,13 +65,13 @@ func addLicense(c *Context, w http.ResponseWriter, r *http.Request) {
license = model.LicenseFromJson(strings.NewReader(licenseStr))
if result := <-Srv.Store.User().AnalyticsUniqueUserCount(""); result.Err != nil {
- c.Err = model.NewAppError("addLicense", "Unable to count total unique users.", fmt.Sprintf("err=%v", result.Err.Error()))
+ c.Err = model.NewLocAppError("addLicense", api.license.add_license.invalid_count.app_error, nil, result.Err.Error())
return
} else {
uniqueUserCount := result.Data.(int64)
if uniqueUserCount > int64(*license.Features.Users) {
- c.Err = model.NewAppError("addLicense", fmt.Sprintf("This license only supports %d users, when your system has %d unique users. Unique users are counted distinctly by email address. You can see total user count under Site Reports -> View Statistics.", *license.Features.Users, uniqueUserCount), "")
+ c.Err = model.NewAppError("addLicense", api.license.add_license.unique_users.app_error, map[string]interface{}{"Users": *license.Features.Users, "Count": uniqueUserCount})
return
}
}
diff --git a/api/user.go b/api/user.go
index ceaf1fc2d..6ad0f67ac 100644
--- a/api/user.go
+++ b/api/user.go
@@ -1157,7 +1157,7 @@ func uploadProfileImage(c *Context, w http.ResponseWriter, r *http.Request) {
path := "teams/" + c.Session.TeamId + "/users/" + c.Session.UserId + "/profile.png"
if err := writeFile(buf.Bytes(), path); err != nil {
- c.Err = model.NewAppError("uploadProfileImage", "Couldn't upload profile image", "")
+ c.Err = model.NewLocAppError("uploadProfileImage", "api.user.upload_profile_user.upload_profile.app_error", nil, "")
return
}