• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 32. Exception Views > Step 1: Creating an Exception

Step 1: Creating an Exception

To begin creating an exception, you need to create a new package called exceptionview in Zope3-Instance/lib/python/book. Then you should create a file called interfaces.py and add the following exception interface and class to it:

01 from zope.interface import implements
02 from zope.interface.common.interfaces import IException
03
04 class IPaymentException(IException):
05     """This is an exception that can be raised by my application."""
06
07 class PaymentException(Exception):
08     implements(IPaymentException)
09
10     # We really do nothing here.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint