[BlueBream] Exception views, again

Justin Ryan jryan at reliefgarden.org
Tue Aug 3 18:26:48 EDT 2010


Hiya..

So, recently when I asked about this, Michael Howitz responded
helpfully suggesting that I may need a layer declaration, as here:

  http://www.mail-archive.com/bluebream@zope.org/msg00396.html

I also see there is a quick note regarding this at:

  http://bluebream.zope.org/doc/1.0/faq.html#how-do-i-write-a-custom-404-error-page

Not sure if that's new or I just missed it before.

After finishing some other tasks in the project I was working on, I
came back around to this problem and tried this:

  $ paster create -t bluebream unauth

Edited unauth/src/unauth/welcome/interfaces.py to add:

from zope.publisher.interfaces.browser import IDefaultBrowserLayer

class ISampleApplicationBrowserLayer(IDefaultBrowserLayer):
  """Layer for Sample Application."""

Edited unauth/src/unauth/welcome/configure.zcml to add:


  <interface
      interface="unauth.welcome.interfaces.ISampleApplicationBrowserLayer"
      type="zope.publisher.interfaces.browser.IBrowserSkinType"
      name="Unauth"
      />

Added to each browser: block:

      layer="unauth.welcome.interfaces.ISampleApplicationBrowserLayer"

Added:

  <browser:defaultSkin name="Unauth" />

And, the Unauthorized view:

  <browser:page
     for="zope.exceptions.IUnauthorized"
     name="index"
     permission="zope.Public"
     template="unauth.pt"
     layer="unauth.welcome.interfaces.ISampleApplicationBrowserLayer"
     />

Also tried for="zope.security.interfaces.IUnauthorized",
for="zope.publisher.interfaces.INotFound" (as in Baiju's docs linked
above) and for="zope.interface.common.interfaces.IException", to no
avail.

The actual 'simplest use case' project i'm working with right now is at:

  http://meteor.bitmonk.net/unauth-test.tbz2

Clearly, I'm missing something obvious, and I'll be happy to
contribute to making the docs clearer in this area.

Best, and thanks in advance..

Justin


More information about the bluebream mailing list