Commit 082e2911 authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

zopewsgi: enable HTTPExceptionHandler

This middleware is enabled in Zope's mkwsginstance [1] and also in test,
[2], we should also enable it here for consistency.

It is necessary to handle exceptions when no standard_error_message
skin exists, like it is the case today in RJS skin selection.

1: https://github.com/zopefoundation/Zope/blob/828b1973e39f4dc1bf51fea0cd11a236d28ec3b5/src/Zope2/utilities/skel/etc/zope.ini.in#L16
2: https://github.com/zopefoundation/Zope/blob/828b1973e39f4dc1bf51fea0cd11a236d28ec3b5/src/Testing/ZopeTestCase/functional.py#L136
parent 2f2c3a68
......@@ -23,9 +23,12 @@ from Zope2.Startup.run import make_wsgi_app
try:
from ZPublisher.WSGIPublisher import _MODULES
from ZPublisher.WSGIPublisher import publish_module
from ZPublisher.httpexceptions import HTTPExceptionHandler
except ImportError:
# BBB Zope2
from Products.ERP5Type.patches.WSGIPublisher import publish_module
HTTPExceptionHandler = lambda app: app
# this class licensed under the MIT license (stolen from pyramid_translogger)
class TransLogger(object):
......@@ -141,7 +144,7 @@ def app_wrapper(large_file_threshold, webdav_ports):
environ['PATH_INFO'] = path_info
return publish_module(environ, start_response)
return app
return HTTPExceptionHandler(app)
def createServer(application, logger, **kw):
global server
......
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