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

Invalid blog URLs are unhandled 500 errors #1093

Open
victorlin opened this issue Dec 13, 2024 · 4 comments
Open

Invalid blog URLs are unhandled 500 errors #1093

victorlin opened this issue Dec 13, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@victorlin
Copy link
Member

Going to an invalid URL under /blog such as https://nextstrain.org/blog/invalid shows Next.js's 500: Internal Server Error page.

image

Possible solutions

Catch the error and:

  1. Redirect to /blog

  2. Show an error page similar to the one that appears when there is a Markdown parsing error:

    image
@victorlin victorlin added the bug Something isn't working label Dec 13, 2024
@victorlin victorlin changed the title Handle invalid blog URLs Invalid blog URLs are unhandled 500 errors Dec 13, 2024
@genehack
Copy link
Contributor

@victorlin this is probably my fault — I can get it unless you want it?

@victorlin
Copy link
Member Author

this is probably my fault

No worries, I don't remember if we had anything in place before your blog changes. It's possible that it was already broken.

I can get it unless you want it?

All yours!

@victorlin
Copy link
Member Author

Are you planning to (1) redirect or (2) show a custom error page? I've a slight preference for (2)

@genehack
Copy link
Contributor

Are you planning to (1) redirect or (2) show a custom error page? I've a slight preference for (2)

I was going to make it properly 404, ala https://next.nextstrain.org/contact/foo

@genehack genehack self-assigned this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants