[Grok-dev] grok error page customization, DRY

Jasper Spaans jasper at vs19.net
Mon Aug 18 12:07:51 EDT 2008


Op 18 aug 2008, om 17:08 heeft Philipp von Weitershausen het volgende  
geschreven:

>> class CobesNotFound(grok.View, SystemErrorView):
>
> Why are you inheriting from SystemErrorView? AFAIK, doing that will  
> only gain you the ISystemErrorView interface which causes the  
> publication to log the exception as a "SiteError".

Right, that was a bit of copy-pastism, from the IException view.

>> [snip]
>> This feels like I'm repeating myself, so is there some way to fix  
>> this?
>
> Apart from the 'index.html' bit which is annoying but not dramatic,  
> what is it that you'd like to fix?

I'd like the index.html bit to be gone -- I think it's more than  
annoying, not because it is a lot of effort to type, but because it  
took me half an hour to find out what was missing, and somebody else  
will probably run into this issue in the future as well. Although now  
it's properly documented in the mailing list archives of course.

> Note that we Grok could actually set the default view for all  
> Exceptions to 'index' as well. That would make the 'index.html' pain  
> go away. Of course doing this would break everybody's custom  
> exception views because right now they'd be registered as  
> 'index.html'.


That would be a bit of a pain indeed. Just a wild idea: would it make  
sense to deprecate 'index.html' and hacking in a (temporary) grokker  
for grok.name that rewrites index.html to index (while giving a  
deprecation warning) be an option? Or is 'index.html' used as the  
default view for other things?


Jasper


More information about the Grok-dev mailing list