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

Improved 404 for missing questions #287

Closed
knatten opened this issue Mar 14, 2023 · 2 comments · Fixed by #291
Closed

Improved 404 for missing questions #287

knatten opened this issue Mar 14, 2023 · 2 comments · Fixed by #291

Comments

@knatten
Copy link
Owner

knatten commented Mar 14, 2023

The question number in the urls correspond to the primary key in the database. Some have been retracted, some were rejected before they were published, some are not published yet, some don't even exist in the database etc. Every now and then someone expects to be able to increment the id in the url as a way to see all the questions on the site. See e.g. #256, #234, #208, #163

Here's an example for question 10: https://cppquiz.org/quiz/question/10

I suggest we improve the 404 page, so that if one gets to the 404 page due to a question missing (state is not published, or it doesn't exist), we print a better message. In other random missing pages, like https://cppquiz.org/page-that-does-not-exist, we can keep the current one.

Suggestion for message (open to other ideas):

Question X is not published.

If you came here by manually typing in a question ID in the URL, that will not work, as the question IDs are not consecutive.

Maybe you could try another question?

@tocic
Copy link
Contributor

tocic commented Mar 14, 2023

If #278 is merged, you can get the same error by typing the question's number in the navigation bar. Thus, it makes sense to generalize the message:

- If you came here by manually typing in a question ID in the URL, that will not work, as the question IDs are not consecutive.
+ If you came here by manually typing in a question ID, that will not work, as the question IDs are not consecutive.

Also, maybe use may instead of will, since sometimes that does work :)

- If you came here by manually typing in a question ID, that will not work, as the question IDs are not consecutive.
+ If you came here by manually typing in a question ID, that may not work, as the question IDs are not consecutive.

@knatten
Copy link
Owner Author

knatten commented Mar 14, 2023

Yeah that issue is what made me think of it. I'm getting to that one too btw, but might be some days. I also agree that your suggestion for the error message is better than mine.

tocic added a commit to tocic/cppquiz that referenced this issue Mar 19, 2023
Closes knatten#287.

Signed-off-by: tocic <tocic@protonmail.ch>
tocic added a commit to tocic/cppquiz that referenced this issue Mar 19, 2023
Closes knatten#287.

Signed-off-by: tocic <tocic@protonmail.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants