Skip to content

Commit

Permalink
More on MakeZopeAppSmaller:
Browse files Browse the repository at this point in the history
* Move UserError to zope.exceptions. (While at it, restructure zope.exceptions
  a little bit).
  • Loading branch information
philikon committed Apr 4, 2006
0 parents commit c99f2d9
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
46 changes: 46 additions & 0 deletions browser/configure.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<zope:configure
xmlns:zope="http://namespaces.zope.org/zope"
xmlns="http://namespaces.zope.org/browser">

<page
for="zope.interface.common.interfaces.IException"
name="index.html"
template="systemerror.pt"
class="..systemerror.SystemErrorView"
permission="zope.Public"
/>

<page
for="zope.exceptions.INotFoundError"
name="index.html"
template="systemerror.pt"
class="..systemerror.SystemErrorView"
permission="zope.Public"
/>

<page
for="zope.security.interfaces.IUnauthorized"
name="index.html"
permission="zope.Public"
class=".unauthorized.Unauthorized"
/>

<zope:adapter factory=".unauthorized.default_template" name="default" />

<page
for="zope.exceptions.interfaces.IUserError"
name="index.html"
permission="zope.Public"
template="user.pt"
class=".user.UserErrorView"
/>

<page
for="zope.publisher.interfaces.INotFound"
name="index.html"
permission="zope.Public"
template="notfound.pt"
class=".notfound.NotFound"
/>

</zope:configure>
40 changes: 40 additions & 0 deletions interfaces.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
##############################################################################
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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$
"""
__docformat__ = 'restructuredtext'

from zope.interface import Interface, implements

##############################################################################
# BBB 2006/04/03 - to be removed after 12 months

import zope.deferredimport
zope.deferredimport.deprecated(
"UserError has been moved to zope.exceptions.interfaces. This "
"reference will be removed in Zope 3.5.",
UserError = 'zope.exceptions.interfaces:UserError',
IUserError = 'zope.exceptions.interfaces:IUserError',
)

#
##############################################################################

class ISystemErrorView(Interface):
"""Error views that can classify their contexts as system errors
"""

def isSystemError():
"""Return a boolean indicating whether the error is a system errror
"""

0 comments on commit c99f2d9

Please sign in to comment.