Skip to content

Return 404 instead of 500 for missing forum thread - #3307

Merged
gwprice merged 1 commit into
masterfrom
gprice/deleted-thread-404
Apr 10, 2014
Merged

Return 404 instead of 500 for missing forum thread#3307
gwprice merged 1 commit into
masterfrom
gprice/deleted-thread-404

Conversation

@gwprice

@gwprice gwprice commented Apr 10, 2014

Copy link
Copy Markdown

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

gwprice commented Apr 10, 2014

Copy link
Copy Markdown
Author

@jimabramson

@gwprice

gwprice commented Apr 10, 2014

Copy link
Copy Markdown
Author

@marcotuts Please have a look at the error message in discussion_thread_view.coffee

Copy link
Copy Markdown

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
Copy Markdown
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.

Copy link
Copy Markdown

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
Copy Markdown
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

gwprice commented Apr 10, 2014

Copy link
Copy Markdown
Author

Updated

@jimabramson

Copy link
Copy Markdown

👍

@marcotuts

Copy link
Copy Markdown
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