[Zope-dev] Using views for exceptions in Zope 2.12?

Jim Fulton jim at zope.com
Sun May 10 07:19:08 EDT 2009


On May 9, 2009, at 11:52 AM, Chris Withers wrote:

> Hanno Schlichting wrote:
>> Try following the description given in the changelog at
>> http://svn.zope.org/Zope/branches/2.11/doc/CHANGES.txt?view=markup  
>> under
>> "Zope 3-based exception views".
>
> Hmm, so I would I register different views for a KeyError versus an
> AttributeError?


Not unless you actually need different views for them, which you  
probably don't.

In my experience, you only need a few, as described in change notes.   
One additional one that isn't mentioned in the change notes but that I  
use a lot is UserError (zope.exceptions.UserError).  This is an  
exception to raise when you want to display an end-user error message.

Most exceptions are really application errors and should be handled by  
a view for Exception that displays a system error message.

Jim

--
Jim Fulton
Zope Corporation




More information about the Zope-Dev mailing list