English 中文(简体)
UNnicorn + zope 错误处理
原标题:gunicorn + zope error handling

我们正试图设置 unicorn + plone 。 到目前为止, 它运作良好, 但无法处理错误( 404, 500 etcs), 丢弃内部服务器错误, 而它应该返回 plone 错误页面 。

请设一个不存在的页面的例子贴在下面。 问题是,如何设置炮兵,使错误按其他要求由zope/plone自行处理?

欢和欢和欢和

==> var/log/gunicorn-stdout---supervisor-JhaTfg.log <==
2012-05-24 01:41:16 [15137] [ERROR] Error handling request
Traceback (most recent call last):
  File "/home/user/testing/eggs/gunicorn-0.14.3-py2.6.egg/gunicorn/workers/sync.py", line 100, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/home/user/testing/eggs/repoze.retry-1.0-py2.6.egg/repoze/retry/__init__.py", line 90, in __call__
    app_iter = self.application(environ, replace_start_response)
  File "/home/user/testing/eggs/repoze.tm2-1.0b2-py2.6.egg/repoze/tm/__init__.py", line 24, in __call__
    result = self.application(environ, save_status_and_headers)
  File "/home/user/testing/eggs/repoze.vhm-0.14-py2.6.egg/repoze/vhm/middleware.py", line 106, in __call__
    return self.application(environ, start_response)
  File "/home/user/testing/eggs/Zope2-2.13.13-py2.6.egg/ZPublisher/WSGIPublisher.py", line 255, in publish_module
    response = _publish(request,  Zope2 )
  File "/home/user/testing/eggs/Zope2-2.13.13-py2.6.egg/ZPublisher/WSGIPublisher.py", line 185, in publish
    object = request.traverse(path, validated_hook=validated_hook)
  File "/home/user/testing/eggs/Zope2-2.13.13-py2.6.egg/ZPublisher/BaseRequest.py", line 518, in traverse
    return response.notFoundError(URL)
  File "/home/user/testing/eggs/Zope2-2.13.13-py2.6.egg/ZPublisher/HTTPResponse.py", line 718, in notFoundError
    "<p><b>Resource:</b> %s</p>" % escape(entry))
NotFound:   <h2>Site Error</h2>
  <p>An error was encountered while publishing this resource.
  </p>
问题回答

关于我的问题,我忘了提一下 我们在使用WSGI Zope和枪炮

在我们的场景中, 我们为 ZPublisher/WSGIPlisher.py 补了补丁, 以妥善处理“非功能”例外(404), 而不是扔出500个内部服务器错误 。

发现 Zope + Wsgi 尚未成熟( 至少在处理错误时) 。





相关问题
Install Plone egg as a Python module on Windows

I have a Plone site (Plone version 3.1.2) that I need to install a product called GrufSpaces on - (http://plone.org/products/grufspaces). However, it is a production site and so I can t easily take it ...

Zope / Plone 3 product uninstsall issue

Hey all, I uninstalled a content type that I d previously added and afterward I m still getting a warning of 2010-01-06 22:43:50 WARNING OFS.Uninstalled Could not import class myclass from module ...

Custom traversal and page templates

Using Marius Gedminas s excellent blog post, I have created a custom traverser for a folder in my site. This allows me to show: http://foo.com/folder/random_id Instead of: http://foo.com/folder/...

Moving (very old) Zope/Plone Site to Django

I am ask to move data from a (now offline) site driven by Plone to a new Django site. These are the version informations I have: Zope Version (unreleased version, python 2.1.3 ) Python Version 2.1....

热门标签