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
[DX] improve file loader errors for router #11958
Comments
@lmammino I think that this is a proposal that we should take into account. This error may not happen often, but when it occurs, the error message is totally misleading. The solution could be easy: just after these lines that set the "Cannot load resource %s" part, we could add some check to see if the directory exists and is readable, just before these other lines which output the bundle related message. |
@javiereguiluz This is probably not the only case where things like that happen. Would it be an idea to allow some sort of error analyzing in general? Symfony already has the ability to suggest typo issues for example. |
@iltar you are right. But I love to evolve the framework in small but continuous steps. If we look for all kind of errors and try to fix them all at once, the PR will take months ... and it will probably never be merged. Fixing this issue is a quick win both for the framework and the end user. |
I do agree with both you @javiereguiluz and @iltar. It's good to fix this ASAP and maybe we can start having a global look at the error messages for the whole framework and see if there's something else we can fix/improve. |
Anyone willing to work on this one? Or let's close it. |
@fabpot just submitted a pull request :-) |
#13969 is closed because implementing this properly would require a bundle location resolver. I can think of only way to improve the DX, update the exception message.
The directory name is easily extractable, the full path is not. |
I think @sstok proposal is good enough to solve the issue right now 😉 |
ping @javiereguiluz is this the wrong PR, or any chance, maybe i should just close it? |
…ng resource (cordoval) This PR was merged into the 2.3 branch. Discussion ---------- [Config][DX] improve file loader error message for missing resource |Q |A | |--- |--- | |Bug Fix? |y | |New Feature? |n | |BC Breaks? |n | |Deprecations?|n | |Tests Pass? |y | |Fixed Tickets|#11958| |License |MIT | |Doc PR | | Commits ------- a2deb61 [DX] improve file loader error for router/other resources in bundle
I had this error today after pulling out the commit of a colleague (he just had created a new bundle):
The bundle was correctly created and registered. The problem was that he hadn't written any controller (and deleted the default one). So the
Controller
folder remained empty and wasn't committed.I struggled out for a while before having been able to find the problem.
I think the error message is wrong here. We might improve it and just state the the "/Controller" folder was missing in the bundle. Didn't had a look at the code yet but I think it can be easy to add this check and improve the error message.
What do you think?
The text was updated successfully, but these errors were encountered: