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:
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user