summaryrefslogtreecommitdiffstats
path: root/api/post.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-09-01 14:58:43 +0100
committerJoram Wilander <jwawilander@gmail.com>2017-09-01 09:58:43 -0400
commit75c63344def7a108f1257b99e0342330da882a38 (patch)
treea5090e735eacf2d4dea4877a3b84e1f276e1f66b /api/post.go
parent718da3593b6feb1c3546b1e17c30c22990157ed5 (diff)
downloadchat-75c63344def7a108f1257b99e0342330da882a38.tar.gz
chat-75c63344def7a108f1257b99e0342330da882a38.tar.bz2
chat-75c63344def7a108f1257b99e0342330da882a38.zip
Api: NewLocAppError -> NewAppError (#7280)
Diffstat (limited to 'api/post.go')
-rw-r--r--api/post.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/api/post.go b/api/post.go
index 367696ec1..89f85160f 100644
--- a/api/post.go
+++ b/api/post.go
@@ -282,8 +282,7 @@ func getPost(c *Context, w http.ResponseWriter, r *http.Request) {
return
} else {
if !list.IsChannelId(channelId) {
- c.Err = model.NewLocAppError("getPost", "api.post.get_post.permissions.app_error", nil, "")
- c.Err.StatusCode = http.StatusForbidden
+ c.Err = model.NewAppError("getPost", "api.post.get_post.permissions.app_error", nil, "", http.StatusForbidden)
return
}
@@ -306,7 +305,7 @@ func getPostById(c *Context, w http.ResponseWriter, r *http.Request) {
return
} else {
if len(list.Order) != 1 {
- c.Err = model.NewLocAppError("getPostById", "api.post_get_post_by_id.get.app_error", nil, "")
+ c.Err = model.NewAppError("getPostById", "api.post_get_post_by_id.get.app_error", nil, "", http.StatusInternalServerError)
return
}
post := list.Posts[list.Order[0]]
@@ -395,8 +394,7 @@ func deletePost(c *Context, w http.ResponseWriter, r *http.Request) {
return
} else {
if post.ChannelId != channelId {
- c.Err = model.NewLocAppError("deletePost", "api.post.delete_post.permissions.app_error", nil, "")
- c.Err.StatusCode = http.StatusForbidden
+ c.Err = model.NewAppError("deletePost", "api.post.delete_post.permissions.app_error", nil, "", http.StatusForbidden)
return
}