How should we handle errors in the config file? Maybe this has more to
do with filter config than config in general, so here goes an example:
[/style]
static_filter.on = True
Woops. Missing something there, aren't I? What I get in return is a
500 error in my log and this traceback:
------------------------
10/Dec/2005:13:25:51 HTTP INFO Traceback (most recent call last):
File
"C:\Python24\lib\site-packages\cherrypy_src\cherrypy\_cphttptools.py",
line 91, in _run
applyFilters('before_main')
File
"C:\Python24\lib\site-packages\cherrypy_src\cherrypy\filters\__init__.py",
line 124, in applyFilters
method()
File
"C:\Python24\lib\site-packages\cherrypy_src\cherrypy\filters\staticfilter.py",
line 36, in before_main
filename = os.path.join(staticDir, extraPath)
File "C:\Python24\lib\ntpath.py", line 90, in join
assert len(path) > 0
TypeError: len() of unsized object
---------------------------
Should that be the response or should there be some more descriptive
error in the log? Something along the lines of "<date> CONFIG WARNING
staticfilter.on = True without corresponding .file, .dir or .match".
Along with a 404 instead of a 500?
Or maybe the 500 is the right approach and the filter just needs to
raise a different exception with a more descriptive message? Any
thoughts?
Christian
http://www.dowski.com
IMO, CherryPy should refuse to start if there are such errors.
> Along with a 404 instead of a 500?
I don't think it should get that far (to the request level).
Robert Brewer
System Architect
Amor Ministries
fuma...@amor.org
Good point. I'm glad I ask questions before I run off and submit
changes to svn :-)
Christian
http://www.dowski.com