[Checkins] [zopefoundation/zope.configuration] e0dc15: Simplify exception chaining and nested exception e...
GitHub
noreply at github.com
Fri Sep 28 01:43:24 CEST 2018
Branch: refs/heads/issue43
Home: https://github.com/zopefoundation/zope.configuration
Commit: e0dc156f7ab89ac6b7ddcf52028646fd8e7d6900
https://github.com/zopefoundation/zope.configuration/commit/e0dc156f7ab89ac6b7ddcf52028646fd8e7d6900
Author: Jason Madden <jamadden at gmail.com>
Date: 2018-09-27 (Thu, 27 Sep 2018)
Changed paths:
M CHANGES.rst
M docs/narr.rst
M src/zope/configuration/config.py
M src/zope/configuration/exceptions.py
M src/zope/configuration/tests/test_config.py
M src/zope/configuration/tests/test_xmlconfig.py
M src/zope/configuration/xmlconfig.py
Log Message:
-----------
Simplify exception chaining and nested exception error messages.
Fixes #43
Given a/b/c/d.zcml included in that order with an error in d.zcml,
previously we would get this:
```
Traceback (most recent call last):
...
raise InvalidDottedName(value).with_field_and_value(self, value)
zope.schema.interfaces.InvalidDottedName: invalid dotted name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
...
raise InvalidDottedName(value).with_field_and_value(self, value)
zope.configuration.exceptions.ConfigurationError: ('Invalid value for', 'package', 'invalid dotted name')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
...
raise InvalidDottedName(value).with_field_and_value(self, value)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/tmp/d.zcml", line 2.4-2.58
ConfigurationError: ('Invalid value for', 'package', 'invalid dotted name')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
...
raise InvalidDottedName(value).with_field_and_value(self, value)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/tmp/c.zcml", line 2.4-2.29
ZopeXMLConfigurationError: File "/tmp/d.zcml", line 2.4-2.58
ConfigurationError: ('Invalid value for', 'package', 'invalid dotted name')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
...
raise InvalidDottedName(value).with_field_and_value(self, value)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/tmp/b.zcml", line 2.4-2.29
ZopeXMLConfigurationError: File "/tmp/c.zcml", line 2.4-2.29
ZopeXMLConfigurationError: File "/tmp/d.zcml", line 2.4-2.58
ConfigurationError: ('Invalid value for', 'package', 'invalid dotted name')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
...
raise InvalidDottedName(value).with_field_and_value(self, value)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/tmp/a.zcml", line 2.4-2.29
ZopeXMLConfigurationError: File "/tmp/b.zcml", line 2.4-2.29
ZopeXMLConfigurationError: File "/tmp/c.zcml", line 2.4-2.29
ZopeXMLConfigurationError: File "/tmp/d.zcml", line 2.4-2.58
ConfigurationError: ('Invalid value for', 'package', 'invalid dotted name')
```
Now we get the simpler:
```
Traceback (most recent call last):
...
File "/Users/jmadden/Projects/GithubSources/zope.schema/src/zope/schema/_field.py", line 670, in _validate
raise InvalidDottedName(value).with_field_and_value(self, value)
zope.schema.interfaces.InvalidDottedName: invalid dotted name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
...
raise InvalidDottedName(value).with_field_and_value(self, value)
zope.configuration.exceptions.ConfigurationError: Invalid value for 'package': InvalidDottedName('invalid dotted name')
zope.schema.interfaces.InvalidDottedName: invalid dotted name
File "/tmp/d.zcml", line 2.4-2.58
File "/tmp/c.zcml", line 2.4-2.29
File "/tmp/b.zcml", line 2.4-2.29
File "/tmp/a.zcml", line 2.4-2.29
```
**NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/
Functionality will be removed from GitHub.com on January 31st, 2019.
More information about the checkins
mailing list