Commit 7a6e04c1 authored by Vincent Pelletier's avatar Vincent Pelletier

ERP5Type/patches/WSGIPublisher: Consider the error handled if err_hook reraised.

err_hook may re-raise when it is specifically told not to render an error
page. Such exception does not mean err_hook failed, so it should not be
re-raised by WSGIPublisher: re-raising in WSGIPublisher means handing the
exception over to waitress, which will have no other choice than producing a
generic error page that we have no control over.
parent abf2ac13
......@@ -280,6 +280,7 @@ def transaction_pubevents(request, response, err_hook, tm=transaction.manager):
exc_info = (exc_type, exc, sys.exc_info()[2])
try:
retry = False
try:
# Raise exception from app if handle-errors is False
# (set by zope.testbrowser in some cases)
......@@ -290,7 +291,6 @@ def transaction_pubevents(request, response, err_hook, tm=transaction.manager):
parents = request.get('PARENTS')
if parents:
parents = parents[0]
retry = False
try:
try:
r = err_hook(parents, request, *exc_info)
......@@ -309,7 +309,7 @@ def transaction_pubevents(request, response, err_hook, tm=transaction.manager):
except BaseException as e:
if e is not exc:
raise
exc_view_created = False
exc_view_created = True
else:
# Handle exception view
exc_view_created = _exc_view_created_response(
......
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