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
Uncaptured server errors on 404 #114
Comments
Fixed in #122 |
This is still happening in the current version. Both errors: http://localhost:3000/category/asdf/:
and http://localhost:3000/asdf:
@DAreRodz could you please document here why is this happening and what can we do about it? |
It also happens in these urls, both with the same error: http://localhost:3000/category/chastening
|
It looks like the cause is this
Introduced in this commit about a month ago. |
That's the cause of the console log but we need to know what's making it throw in the first place. Both: TypeError: Cannot destructure property `id` of 'undefined' or 'null'.
// and
TypeError: Cannot read property 'name' of undefined @DAreRodz could you please document here why is this happening and what can we do about it? |
Those errors must be in handlers. I'm checking which of them need to be fixed. |
First case: Attachment and Page handlers could throw that error when the attachment or page is not found. Also, Author, Date, Taxonomy and PostArchive handlers should throw a descriptive error when a page out of range is fetched, but are not implemented correctly, returning the error above. They all fail at this line in The reason is that {
"code": "rest_post_invalid_page_number",
"message": "The page number requested is larger than the number of pages available.",
"data": {
"status": 400
}
} |
Second case: This error is happening at this line in the In the case of |
But I think those errors are expected by design. It's a try catch that when the error is thrown in the handler sets |
Yeah, well, most cases are expected to return with a We have to think of a good way to handle errors. |
Yeah, that makes sense. |
Closed as this doesn't seem to be an issue anymore. |
It looks like right now the server reports 404's on the console. Sometimes like this (http://localhost:3000/category/performance/):
and sometimes like this (http://localhost:3000/page/8):
The text was updated successfully, but these errors were encountered: