-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improve error reporting #13
Comments
Thanks for the report. Error handling / reporting is indeed a sore spot that I would like to see improved, and so is the CLI. Some details deserve explanation:
Actually, after checking the sources, I remembered that we are already doing exactly what you're asking:
This means that your
Ah, terrible shame - the CLI syntax got changed at some point. Previously, sprinkles could only really do one thing, namely, serving the current project, and you would pass options to control the details (which HTTP backend to use, which port to run on, etc.). But with the introduction of the
It's a verb, just like "bake".
Sprinkles should very much produce a bare-bones 404 page, saying something like "Not found" in plain text, when the given path doesn't resolve to any rule, or when the matching rule cannot load a required data item. Likewise, if there is some sort of error while handling the request, like a syntax error in a template, or a crash in a data backend, Sprinkles should serve a default plain-text 500 page. Exposing any more error information than that to the browser is generally considered a security problem (and also a bad thing to do for other reasons), and is best avoided entirely. I do agree however that the error log should contain more useful information, and that it would be helpful to configure more verbose error logging in the tutorial.
The tutorial is part of the git source tree, and the intention is that it matches the version of whatever commit you are looking at. I must admit however that I do not check the tutorial for every commit, or even every release, so it is very possible to be incorrect. Sorry about that.
Agree; logging which exact file sprinkles failed to find might be convenient. There is one caveat with this, which is that it isn't always obvious whether a file is missing by accident or on purpose. Sometimes, you want to load a file if it exists, and silently get
Yes,
Again, a bit of negligence here. In principle, the convention for sprinkles args is to have GNU-style single-dash keyword args, but for mere convenience, and to avoid confusion, we should support EDIT: Actually, I just checked; |
I have just installed from github a727a02 on a debian stretch system. the version is
(suggestion - it would probably more instructive if the last commit was included in the version)
I followed the 001-getting started instruction and when I run
sprinkles 5000
i getwhen i used
sprinkles -serve 5000
I get on opening localhost:5000 (it is not server, as one might expect!)but nothing shows (not even 404). At least an useful error message would be appreciated when one first works with a program. Perhaps it would be better to have as a master branch a version that certainly runs and the development on identified branches and tell in the 001 instructions, which version they were tested with.
I later found the my error: the
home.markdown
had a mistyped extension (makrdown
) which explains that nothing was found. still a helpful error message would be appreciated.some comments:
the command should have a -h and a --help text, which tells what functions are possible (I think this can be created automatically with CmdLineUtilities.UtilsProcessCmd). It seems to be customary to have -v and --version switches, but not -version.
interesting but challenging project!
The text was updated successfully, but these errors were encountered: