-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return 404 instead of 500 for missing forum thread #3307
Conversation
@marcotuts Please have a look at the error message in discussion_thread_view.coffee |
if xhr.status == 404 | ||
DiscussionUtil.discussionAlert( | ||
gettext("Sorry"), | ||
gettext("The thread you selected has been deleted. Please select another thread.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about "does not exist or has been deleted" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no way to reach this without selecting a thread, so it must have existed at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently when i put a bad url directly into the browser such as https://courses.edx.org/courses/BerkeleyX/CS-191x/2013_August/discussion/forum/i4x-BerkeleyX-CS191x-course-2013_Spring/threads/thisdoesnotexist then I get a 500. Does this PR change that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you access a thread's URL directly, then we will return a 404 with the standard 404 page; this particular bit of code is handling an AJAX request for a 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.
Updated |
👍 |
:thumbs up: |
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.