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

Leonardo Rochael Almeida leorochael at gmail.com
Tue Sep 18 11:57:20 EDT 2007


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

Perhaps Grok could grow a grok.ErrorView base class that would already
set the grok.name("index.html")

On 9/18/07, Sebastian Ware <sebastian at urbantalk.se> wrote:
> I want to catch errors after they have thrown an exception (think
> Zope 2.x standard_error_page). Can this be done in a simple way?


More information about the Grok-dev mailing list