diff options
author | George Goldberg <george@gberg.me> | 2017-09-01 14:58:43 +0100 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-09-01 09:58:43 -0400 |
commit | 75c63344def7a108f1257b99e0342330da882a38 (patch) | |
tree | a5090e735eacf2d4dea4877a3b84e1f276e1f66b /api/license.go | |
parent | 718da3593b6feb1c3546b1e17c30c22990157ed5 (diff) | |
download | chat-75c63344def7a108f1257b99e0342330da882a38.tar.gz chat-75c63344def7a108f1257b99e0342330da882a38.tar.bz2 chat-75c63344def7a108f1257b99e0342330da882a38.zip |
Api: NewLocAppError -> NewAppError (#7280)
Diffstat (limited to 'api/license.go')
-rw-r--r-- | api/license.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/api/license.go b/api/license.go index 162dd6762..081fa7ed9 100644 --- a/api/license.go +++ b/api/license.go @@ -34,14 +34,12 @@ func addLicense(c *Context, w http.ResponseWriter, r *http.Request) { fileArray, ok := m.File["license"] if !ok { - c.Err = model.NewLocAppError("addLicense", "api.license.add_license.no_file.app_error", nil, "") - c.Err.StatusCode = http.StatusBadRequest + c.Err = model.NewAppError("addLicense", "api.license.add_license.no_file.app_error", nil, "", http.StatusBadRequest) return } if len(fileArray) <= 0 { - c.Err = model.NewLocAppError("addLicense", "api.license.add_license.array.app_error", nil, "") - c.Err.StatusCode = http.StatusBadRequest + c.Err = model.NewAppError("addLicense", "api.license.add_license.array.app_error", nil, "", http.StatusBadRequest) return } @@ -50,7 +48,7 @@ func addLicense(c *Context, w http.ResponseWriter, r *http.Request) { file, err := fileData.Open() defer file.Close() if err != nil { - c.Err = model.NewLocAppError("addLicense", "api.license.add_license.open.app_error", nil, err.Error()) + c.Err = model.NewAppError("addLicense", "api.license.add_license.open.app_error", nil, err.Error(), http.StatusInternalServerError) return } |