Commit a4b93feb authored by Lukas Matt's avatar Lukas Matt

Replace some 500 error messages with 404

parent 2dc38660
......@@ -76,8 +76,8 @@ type ApiNotification struct {
* "error": "[...]"
* }
*
* @apiErrorExample {json} ServerError
* HTTP/1.1 500 Internal Server Error
* @apiErrorExample {json} NotFound
* HTTP/1.1 404 Not Found
* {
* "error": "[...]"
* }
......@@ -87,8 +87,8 @@ func (n ApiNotification) Index(fields string, offset int) revel.Result {
var notify models.Notifications
err := notify.FindByUserID(n.CurrentUser.ID, offset)
if err != nil {
n.Log.Error(TAG, "db", err, "api", ERR_SERVER)
return n.ApiError(http.StatusInternalServerError, ERR_SERVER)
n.Log.Error(TAG, "db", err, "api", ERR_NOT_FOUND)
return n.ApiError(http.StatusNotFound, ERR_NOT_FOUND)
}
return n.RenderJSON(
......
......@@ -80,8 +80,8 @@ type ApiPost struct {
* "error": "[...]"
* }
*
* @apiErrorExample {json} ServerError
* HTTP/1.1 500 Internal Server Error
* @apiErrorExample {json} NotFound
* HTTP/1.1 404 Not Found
* {
* "error": "[...]"
* }
......@@ -109,8 +109,8 @@ func (p ApiPost) Index() revel.Result {
}
if err != nil {
p.Log.Error(TAG, "db", err, "api", ERR_SERVER)
return p.ApiError(http.StatusInternalServerError, ERR_SERVER)
p.Log.Error(TAG, "db", err, "api", ERR_NOT_FOUND)
return p.ApiError(http.StatusNotFound, ERR_NOT_FOUND)
}
return p.RenderJSON(
......@@ -286,8 +286,8 @@ func (p ApiPost) Create() revel.Result {
* "error": "[...]"
* }
*
* @apiErrorExample {json} ServerError
* HTTP/1.1 500 Internal Server Error
* @apiErrorExample {json} NotFound
* HTTP/1.1 404 Not Found
* {
* "error": "[...]"
* }
......@@ -306,8 +306,8 @@ func (p ApiPost) Show(guid string) revel.Result {
err = post.FindByGuidAndUser(guid, p.CurrentUser)
}
if err != nil {
p.Log.Error(TAG, "db", err, "api", ERR_SERVER)
return p.ApiError(http.StatusInternalServerError, ERR_SERVER)
p.Log.Error(TAG, "db", err, "api", ERR_NOT_FOUND)
return p.ApiError(http.StatusNotFound, ERR_NOT_FOUND)
}
return p.RenderJSON(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment