Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
780a3726
Commit
780a3726
authored
Jul 14, 2009
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged c101882 from 2.12 branch
parent
c07f53d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
src/Zope2/App/startup.py
src/Zope2/App/startup.py
+4
-1
src/Zope2/App/tests/testExceptionHook.py
src/Zope2/App/tests/testExceptionHook.py
+6
-4
No files found.
src/Zope2/App/startup.py
View file @
780a3726
...
...
@@ -23,6 +23,7 @@ from Acquisition import aq_parent
from
App.config
import
getConfiguration
from
time
import
asctime
from
types
import
StringType
,
ListType
from
zExceptions
import
upgradeException
from
zExceptions
import
Redirect
from
zExceptions
import
Unauthorized
from
ZODB.POSException
import
ConflictError
...
...
@@ -167,8 +168,10 @@ class ZPublisherExceptionHook:
def
__call__
(
self
,
published
,
REQUEST
,
t
,
v
,
traceback
):
try
:
t
,
v
=
upgradeException
(
t
,
v
)
if
t
is
SystemExit
or
issubclass
(
t
,
Redirect
):
raise
raise
t
,
v
,
traceback
if
issubclass
(
t
,
ConflictError
):
self
.
logConflicts
(
v
,
REQUEST
)
...
...
src/Zope2/App/tests/testExceptionHook.py
View file @
780a3726
...
...
@@ -115,19 +115,21 @@ class ExceptionHookTestCase(unittest.TestCase):
class
ExceptionHookTest
(
ExceptionHookTestCase
):
def
testStringException1
(
self
):
from
zExceptions
import
Unauthorized
def
f
():
raise
'
u
nauthorized'
,
'x'
raise
'
U
nauthorized'
,
'x'
if
sys
.
version_info
<
(
2
,
6
):
self
.
assertRaises
(
'unauthorized'
,
self
.
call
,
None
,
None
,
f
)
self
.
assertRaises
(
Unauthorized
,
self
.
call
,
None
,
None
,
f
)
else
:
# Raising a string exception causes a TypeError on Python 2.6
self
.
assertRaises
(
TypeError
,
self
.
call
,
None
,
None
,
f
)
def
testStringException2
(
self
):
from
zExceptions
import
Redirect
def
f
():
raise
'
r
edirect'
,
'x'
raise
'
R
edirect'
,
'x'
if
sys
.
version_info
<
(
2
,
6
):
self
.
assertRaises
(
'redirect'
,
self
.
call
,
None
,
None
,
f
)
self
.
assertRaises
(
Redirect
,
self
.
call
,
None
,
None
,
f
)
else
:
# Raising a string exception causes a TypeError on Python 2.6
self
.
assertRaises
(
TypeError
,
self
.
call
,
None
,
None
,
f
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment