From 75c63344def7a108f1257b99e0342330da882a38 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Fri, 1 Sep 2017 14:58:43 +0100 Subject: Api: NewLocAppError -> NewAppError (#7280) --- api/license.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'api/license.go') 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 } -- cgit v1.2.3-1-g7c22