diff --git a/src/lua/endpoints/edit_post.lua b/src/lua/endpoints/edit_post.lua index 8df2fec..b3505ee 100644 --- a/src/lua/endpoints/edit_post.lua +++ b/src/lua/endpoints/edit_post.lua @@ -41,7 +41,16 @@ local function edit_post(req) local err = util.do_sql(stmnt_author_of) if err ~= sql.ROW then stmnt_author_of:reset() - error("No author found for story:" .. storyid) + local msg = string.format("No author found for story: %d", storyid) + log(LOG_ERR,msg) + local response = pages.error{ + errcode = 404, + errcodemsg = "Not Found", + explanation = msg, + should_traceback = true, + } + http_response(req,404,response) + return end local data = stmnt_author_of:get_values() stmnt_author_of:reset()