[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces - exceptions.py:1.1

Jim Fulton jim@zope.com
Fri, 7 Mar 2003 07:06:41 -0500


Update of /cvs-repository/Zope3/src/zope/app/interfaces
In directory cvs.zope.org:/tmp/cvs-serv4990/src/zope/app/interfaces

Added Files:
	exceptions.py 
Log Message:
Added simpe UserError exceptions and a view for displaying them.
UserErrors should be raised when a user has made an error. UserErrors
will, generally, not be caught and handled by software, but will be
displayed to the user.

The currentl view just displays the arguments passed to the error as a
single paragraph, which should be fine for small error messages.

There are lots of ways we might expand on this eventually.


=== Added File Zope3/src/zope/app/interfaces/exceptions.py ===
##############################################################################
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
##############################################################################
"""General exceptions

$Id: exceptions.py,v 1.1 2003/03/07 12:06:37 jim Exp $
"""
__metaclass__ = type

from zope.interface import Interface

class IUserError(Interface):
    """User error exceptions
    """

class UserError(Exception):
    """User errors

    These exceptions should generally be displayed to users unless
    they are handled.
    """

    __implements__ = IUserError