Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/models/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const wrapper = (callback) => (params) =>
if (e.response?.status === 404) return { notFound: true };
return {
redirect: {
destination: '/500',
destination: '/404',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I re-think this change, I think it is problematic, the previous logic is:

  1. If the status code is 404, then return notFound, which means 404 page.
  2. If any other case, return 500, means, unknown internal error
    So I think we shouldn't make all error 404, that's confusing.

Back the the issue, the URL return 500 but 404, I thought this is because of some 500 error in the server side, but it is 404, so we need to debug the specific URL to see what happened, and handle that error then throw 404 to the wrapper.

permanent: false,
},
revalidate: Number(process.env.NEXT_CACHE_REVALIDATION_OVERRIDE) || 30,
Expand Down