[Grok-dev] Re: How do I mimick the standard_error_page of Zope 2.x?

Sebastian Ware sebastian at urbantalk.se
Thu Sep 20 05:37:33 EDT 2007


Unfortunately changing...

   grok.name("index")

...to...

   grok.name("index.html")

...doesn't work either (I have tried different permutations,  
including using the common.interfaces.IException as context). Has  
anyone got this to work? It would be a great way of improving the  
presentation of errors.

Mvh Sebastian

20 sep 2007 kl. 11.00 skrev Philipp von Weitershausen:

> On 20 Sep 2007, at 09:04 , Sebastian Ware wrote
>> I don't seem to get this right. I was hoping that this grok.View  
>> class would be called whenever the INotFound exception was thrown  
>> (thus redirecting to the Index view of that exception).
>
> It doesn't redirect. It just gets the default view for the exception.
>
>> But all I get is the Rotterdam skin.
>
> Um, because the default view for exceptions is called 'index.html',  
> as already discussed in this thread. Look at Leonardo's example  
> more carefully.
>
>>   class NotFound(grok.View):
>>       grok.context(publisher.interfaces.INotFound)
>>       #grok.context(common.interfaces.IException)
>>       grok.name("index")
>>
>>       def render(self):
>>           return "There was an error finding the resource you were  
>> looking for!"
>
>
>



More information about the Grok-dev mailing list