[Grok-dev] Re: How do I mimick the standard_error_page of Zope
2.x?
Sebastian Ware
sebastian at urbantalk.se
Wed Sep 19 03:33:35 EDT 2007
I will write a short tutorial on this once I have got it right :)
unfortunately, the following view class doesn't seem to get called:
class NotFound(grok.View):
grok.context(publisher.interfaces.INotFound)
#grok.context(common.interfaces.IException)
grok.name("index.html")
def render(self):
return "There was an error finding the resource you were
looking for!"
Instead I get the "The page that you are trying to access is not
available" from the rotterdam (!?) skin. Any ideas
Mvh Sebastian
18 sep 2007 kl. 23.50 skrev Philipp von Weitershausen:
> Leonardo Rochael Almeida wrote:
>> Perhaps something like this would work (untested)?
>> class NotFound(grok.View):
>> grok.context(zope.publisher.interfaces.INotFound)
>> # or grok.context(zope.interface.common.interfaces.IException)
>> grok.name("index.html")
>> [...]
>> At least the equivalent registrations above are the way to implement
>> error views in Zope, according to the exception hook in the
>> ZPublisher
>> for 2.11. Didn't check how it is implemented in pure Zope3
>
> This way is correct. It was actually borrowed from Zope 3 where it
> appeared first.
>
>> Perhaps Grok could grow a grok.ErrorView base class that would
>> already
>> set the grok.name("index.html")
>
> Or we define the default view name for exceptions to be 'index'?
>
>
> --
> http://worldcookery.com -- Professional Zope documentation and
> training
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> http://mail.zope.org/mailman/listinfo/grok-dev
More information about the Grok-dev
mailing list