-
Notifications
You must be signed in to change notification settings - Fork 212
"The requested crate does not exist" message if a version does not exist #55
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
Comments
Error messages definitely needs improvements. docs.rs is also giving same error message when an author not exists, i.e: https://docs.rs/releases/non-existent-author |
Triage: This should be an easy fix, error messages in general do need improvement still |
Mentor:
|
I'll start working on this. Thank you @Kixiron for the detailed description of what to do 😊 |
Mhh, doesn't seem to be as easy as it first looked. As a start, I'm not even able to reproduce the error.
which maps to to the I tried tracking down if the Lines 182 to 232 in bfa6ada
It seems like the error might lie in the chaining of the handlers, the branch in line 189 is not entered even if a |
I think that handler shouldn't be modifying the error at all, just logging it. If you remove the |
The |
You can use
Hmm ... could you switch the order so that the There's probably a more robust way to do this but this should enough to fix the problem, if you think of a better way do let me know though. |
Trying to reproduce the issue rust-lang#55 revealed another bug: the order in which the different handlers were called in CratesfyiHandler::handle resulted in the more specific errors from the router_handler being dropped, due to them being 404 and the last handler being the static_handler which would just return a ResourceNotFound error. It should be noted that the different execution order might affect the performance in production.
Yes, changing the order of the handlers somewhat solves the problem for now. I guess it's okay since the It should be noted that changing the order of the handlers might change the performance of the service in production. PR #1043 contains a bug-fix for the handler order issue and introduces the |
It will, but it will change it for the better ;) since it's only doing expensive database lookups after the cheap things fail. Thanks for thinking about it though! In any case it should only be a minor difference since almost all requests are to the shared resource handler or router, I think only
This is true, but I don't foresee more specific errors: all the previous handlers are for static files. |
Trying to reproduce the issue rust-lang#55 revealed another bug: the order in which the different handlers were called in CratesfyiHandler::handle resulted in the more specific errors from the router_handler being dropped, due to them being 404 and the last handler being the static_handler which would just return a ResourceNotFound error. It should be noted that the different execution order might affect the performance in production.
Trying to reproduce the issue #55 revealed another bug: the order in which the different handlers were called in CratesfyiHandler::handle resulted in the more specific errors from the router_handler being dropped, due to them being 404 and the last handler being the static_handler which would just return a ResourceNotFound error. It should be noted that the different execution order might affect the performance in production.
Oops, seems like my fix to this produced some errors in prod which were not visible in testing #1051 . PR #1052 reverted the change responsible for this which again breaks the message. If that seems like a sensible thing and no one has an idea how to solve the problem more elegantly, I'd be happy to send another PR :) |
Yeah I misunderstood what was going on -
That seems reasonable - I tried that and ran into some edge cases where it didn't quite work (requesting |
This fixes rust-lang#55 while avoiding the mistake of placing the router_handler after the database_file_handler which acts differently in test and prod (rust-lang#1051).
I don't think #1090 fixes this, it changed "the requested resource does not exist" to "the requested crate does not exist", but I don't see any "the requested version does not exist" messages. |
Uh oh!
There was an error while loading. Please reload this page.
"The requested crate does not exist" is the message if you try to load up docs for a crate that exists, in a version that does not. Could just use a small tweak in how it reports the error.
The text was updated successfully, but these errors were encountered: