Commit 5bde5c8f authored by Hanno Schlichting's avatar Hanno Schlichting

Removed handling of string exceptions from ZPublisherExceptionHook and...

Removed handling of string exceptions from ZPublisherExceptionHook and reverted the addition of Unauthorized exceptions to be always re-raised. This broke the tests.
parent 72c81284
...@@ -39,7 +39,7 @@ Bugs Fixed ...@@ -39,7 +39,7 @@ Bugs Fixed
- ObjectManagerNameChooser now also works with BTreeFolder2. - ObjectManagerNameChooser now also works with BTreeFolder2.
- Correctly handle unauthorized exceptions in the ZPublisherExceptionHook. - Correctly handle exceptions in the ZPublisherExceptionHook.
Zope 2.12.0 b2 (2009/05/27) Zope 2.12.0 b2 (2009/05/27)
--------------------------- ---------------------------
......
...@@ -167,29 +167,24 @@ class ZPublisherExceptionHook: ...@@ -167,29 +167,24 @@ class ZPublisherExceptionHook:
def __call__(self, published, REQUEST, t, v, traceback): def __call__(self, published, REQUEST, t, v, traceback):
try: try:
if isinstance(t, StringType): if t is SystemExit or issubclass(t, Redirect):
if t.lower() in ('unauthorized', 'redirect'): raise
raise
else: if issubclass(t, ConflictError):
if (t is SystemExit or self.logConflicts(v, REQUEST)
issubclass(t, Redirect) or issubclass(t, Unauthorized)): raise ZPublisher.Retry(t, v, traceback)
raise
if t is ZPublisher.Retry:
try:
v.reraise()
except:
# we catch the re-raised exception so that it gets
# stored in the error log and gets rendered with
# standard_error_message
t, v, traceback = sys.exc_info()
if issubclass(t, ConflictError): if issubclass(t, ConflictError):
self.logConflicts(v, REQUEST) # ouch, a user saw this conflict error :-(
raise ZPublisher.Retry(t, v, traceback) self.unresolved_conflict_errors += 1
if t is ZPublisher.Retry:
try:
v.reraise()
except:
# we catch the re-raised exception so that it gets
# stored in the error log and gets rendered with
# standard_error_message
t, v, traceback = sys.exc_info()
if issubclass(t, ConflictError):
# ouch, a user saw this conflict error :-(
self.unresolved_conflict_errors += 1
try: try:
log = aq_acquire(published, '__error_log__', containment=1) log = aq_acquire(published, '__error_log__', containment=1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment