Return 404 instead of 500 for missing forum thread

Also show a more specific error message in the front end. This change
only has an effect if using cs_comments_service commit 1d71330 or later.
This commit is contained in:
Greg Price
2014-04-09 16:34:09 -04:00
parent 3fd89a0db4
commit ecf9923e96
3 changed files with 38 additions and 10 deletions

View File

@@ -57,8 +57,13 @@ if Backbone?
@responses.add(data['content']['children'])
@renderResponseCountAndPagination(data['content']['resp_total'])
@trigger "thread:responses:rendered"
error: =>
if firstLoad
error: (xhr) =>
if xhr.status == 404
DiscussionUtil.discussionAlert(
gettext("Sorry"),
gettext("The thread you selected has been deleted. Please select another thread.")
)
else if firstLoad
DiscussionUtil.discussionAlert(
gettext("Sorry"),
gettext("We had some trouble loading responses. Please reload the page.")