[Grok-dev] Custom not found page

Wichert Akkerman wichert at wiggy.net
Sat Nov 14 04:24:10 EST 2009

On 11/14/09 00:03 , Kevin Teague wrote:
> Well, since you just asked for a "hint" and I don't have the full
> answer :P
> You've got:
> metal:use-macro="context/@@mblosum/macros/standard"
> But in a INotFound view, the context isn't your Application object,
> but a NotFound object.

I've always found that to be somewhat confusing behaviour. In a Zope 2 
context I use an error view like this:

class ErrorView(grok.View):

     def update(self):
         log.exception("Error at %r", self.context)

That gives you a more common context and exposes the exception as 
view.exception. I would expect a similar trick to work in a Zope 3 
environment as well.


More information about the Grok-dev mailing list