Closed luisbg closed 8 years ago
I can add that error printing when the controller is missing if you tell me how/where you want it printed :smile:
Yea, I think it's best to add already some kind of error message :)
An error("Your message")
should do :)
Nice! error() shows a page using the default template showing the error and stack trace. Neat.
What's missing in this case is not the controller, but the view file.
Maybe this would be better?
error("Could not find view file: "..dir.."/"..filename)
You are right. That gives a more verbose error.
Fixing it now.
Oh wait! Guess we both weren't paying attention. If filename is nil, it won't concatenate x)
This is not about not finding the view file, but when a view name is not passed... sorry...
Maybe
error("No view name available.")
or
error("A view name is required.")
?
LOL! Right, if filename is nil it won't help in the concatenation.
but it filename name is nil there is no filename to concatenate with the error message :)
ooops, you replied when I was editing.
I realized this just after my last comment. Gulps (shame)
don't worry, I made the same mistake xD
Thanks Etiene! Enjoy your Friday night :beers:
If filename is nil there is no use for setting the src, we should return early.