Open dragosmiron opened 10 years ago
I would have hoped to see NameError: uninitialized constant PiungController
in here (Piung -> Ping)
Hello @dragosmiron,
Thanks for reporting! I think that this is intended to raise an ActionController::RoutingError
and not a NameError
. Actually, as you can see in the code your linked to, when a controller can't be found, an error is raised. If I understand correctly the aim of this commit, the mentioned error is raised not to be mistaken for an auto loading error. It is easier this way for people to debug their code ; the problem lies in their application and not on the Rails side.
I may be totally wrong though so let's wait for some feedback.
IMO, the use of RoutingError here only makes sense if the controller name has come out of the actual route... which these days, is strongly discouraged at best.
Otherwise, as @dragosmiron says, it's an error in the code -- not something that should end up as a 404.
I think this is an error in the code and should be marked as such, not hidden between another error. Controllers shouldn't come from routes anyway.
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails team are limited, and so we are asking for your help.
If you can still reproduce this error on the 4-1-stable
, 4-0-stable
branches or on master
,
please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions.
Hello, I discovered this 'problem' (in apostrophes as it might not be a problem from your perspective) by chance and is as follows:
If you are defining a route with a bad controller name (maybe misspelled), the error is rescued and raised again as a
RoutingError
. Sometimes as I see the error is silenced completely but I don't know the exact internals. It all happens here: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/routing/route_set.rb#L68I personally consider this as a real error, something that I should have seen reported by airbrake. While it can be considered a routing error, I would like it to be a distinction between stuff entered randomly by users in the addressbar, and how that stuff maps afterwards to controllers and actions. I don't understand why they both get put in this pool of Routing Errors