Skip to content
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

Merged
merged 1 commit into from
Apr 10, 2014

Conversation

gwprice
Copy link

@gwprice gwprice commented Apr 10, 2014

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.

@gwprice
Copy link
Author

gwprice commented Apr 10, 2014

@jimabramson

@gwprice
Copy link
Author

gwprice commented Apr 10, 2014

@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.")

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" ?

Copy link
Author

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.

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?

Copy link
Author

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.
@gwprice
Copy link
Author

gwprice commented Apr 10, 2014

Updated

@jimabramson
Copy link

👍

@marcotuts
Copy link
Contributor

:thumbs up:

gwprice pushed a commit that referenced this pull request Apr 10, 2014
Return 404 instead of 500 for missing forum thread
@gwprice gwprice merged commit f233fcf into master Apr 10, 2014
@gwprice gwprice deleted the gprice/deleted-thread-404 branch April 10, 2014 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants