Zope 3 exception views
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
This packages provides Zope 3 browser views for some generic exceptions.
System Errors
System Errors are errors representing a system failure. At the application level, they are errors that are uncaught by the application and that a developer hasn’t provided a custom error view for.
Zope provides a default system error view that prints an obnoxius terse message and that sets the response status.
To see an example of this, we’ll create a ZPT page with an intentional error:
>>> print http(r""" ... POST /+/zope.app.zptpage.ZPTPage%3D HTTP/1.1 ... Authorization: Basic mgr:mgrpw ... Content-Length: 739 ... Content-Type: multipart/form-data; boundary=---------------------------125598457818223697821067764270 ... Referer: http://localhost:8081/+/zope.app.zptpage.ZPTPage= ... ... -----------------------------125598457818223697821067764270 ... Content-Disposition: form-data; name="field.source" ... ... <html><body tal:content="container/eek" /></html> ... -----------------------------125598457818223697821067764270 ... Content-Disposition: form-data; name="field.expand.used" ... ... ... -----------------------------125598457818223697821067764270 ... Content-Disposition: form-data; name="field.evaluateInlineCode.used" ... ... ... -----------------------------125598457818223697821067764270 ... Content-Disposition: form-data; name="UPDATE_SUBMIT" ... ... Add ... -----------------------------125598457818223697821067764270 ... Content-Disposition: form-data; name="add_input_name" ... ... test.html ... -----------------------------125598457818223697821067764270-- ... """) HTTP/1.1 303 See Other ... Location: http://localhost/@@contents.html ...
When we visit it, we get a terse error and a 500 status:
We get a system error, because the problem is in the template, not in the URL:
>>> print http(r""" ... GET /test.html HTTP/1.1 ... """) HTTP/1.1 500 Internal Server Error ... A system error occurred. ...
Another way of getting a system error is the occurrence of a system error, such as ComponentLookupError. I have registered a simple view in exception-ftesting.zcml that will raise a component lookup error. So if we call componentlookuperror.html, we should get the error message:
>>> print http(r""" ... GET /componentlookuperror.html HTTP/1.1 ... """) HTTP/1.1 500 Internal Server Error ... A system error occurred. ...
CHANGES
3.6.1 (2010-01-08)
Require zope.browserpage which now contains namedtemplate.
Fix ftesting.zcml due to zope.securitypolicy update.
Fix tests using a newer zope.publisher that requires zope.login.
3.6.0 (2009-05-18)
ISystemErrorView interface has been moved to zope.browser.interfaces, leaving BBB import here.
Cut dependency on zope.formlib by requiring newer version of zope.app.pagetemplate which now contains namedtemplate.
3.5.0 (2009-04-06)
Use new zope.authentication instead of zope.app.security.
Removed deprecated code and thus removed dependency on zope.deferredimport.
Removed old zpkg-related SETUP.cfg file.
3.4.2 (2009-01-27)
Substitute zope.app.zapi by direct calls to its wrapped apis. See bug 219302.
Fixed author email and home page.
3.4.1 (2007-10-31)
Resolve ZopeSecurityPolicy deprecation warning.
3.4.0 (2007-10-24)
Initial release independent of the main Zope tree.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file zope.app.exception-3.6.1.tar.gz.
File metadata
- Download URL: zope.app.exception-3.6.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a05cd72958605f08238d8c33ee452a0482e2e0dc31e4a98f744c1534a430c2a
|
|
| MD5 |
19447ab2da8237011c0bf4302c9b8ba1
|
|
| BLAKE2b-256 |
079074dce6107fd14ef5df2cf18e33f92e4a1b827081a55281df3b01b235679d
|