[Grok-dev] better error messages
Sebastian Ware
sebastian at urbantalk.se
Mon May 12 03:18:21 EDT 2008
From the top of my head:
- Missing templates or duplicate render/template (wish they would all
be presented in one pass)
- Any error that ends up pointing to the zcml file...
- zope.configuration.config.ConfigurationConflictError
sample (comment from PvW bellow):
Traceback (most recent call last):
File "/Users/jhsware/groksandbox/Prestatics/parts/app/runzope", line
111, in ?
zope.app.twisted.main.main()
File "/Users/jhsware/buildout-eggs/tmp8l16sK/
zope.app.twisted-3.4.0a1-py2.4.egg/zope/app/twisted/main.py", line 74,
in main
File "/Users/jhsware/buildout-eggs/tmp8l16sK/
zope.app.twisted-3.4.0a1-py2.4.egg/zope/app/twisted/main.py", line
145, in setup
File "/Users/jhsware/buildout-eggs/zope.app.appsetup-3.4.1-py2.4.egg/
zope/app/appsetup/appsetup.py", line 111, in config
context = xmlconfig.file(file, context=context, execute=execute)
File "/Users/jhsware/buildout-eggs/tmpXoSviM/
zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py",
line 612, in file
File "/Users/jhsware/buildout-eggs/tmpXoSviM/
zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py", line
604, in execute_actions
File "/Users/jhsware/buildout-eggs/tmpXoSviM/
zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py", line
1511, in resolveConflicts
zope.configuration.config.ConfigurationConflictError: Conflicting
configuration actions
For: ('adapter', (<class 'prestatics.app.ProtonCMS'>,
<InterfaceClass
zope.publisher.interfaces.browser.IDefaultBrowserLayer>),
<InterfaceClass zope.interface.Interface>, 'add_table')
File "/Users/jhsware/groksandbox/Prestatics/src/prestatics/
configure.zcml", line 4.2-4.27
<grok:grok package="." />
File "/Users/jhsware/groksandbox/Prestatics/src/prestatics/
configure.zcml", line 4.2-4.27
<grok:grok package="." />
For: ('adapter', <InterfaceClass
prestatics.interfaces.IProtonWorkflowItem>, None, '')
File "/Users/jhsware/groksandbox/Prestatics/src/prestatics/
configure.zcml", line 4.2-4.27
<grok:grok package="." />
File "/Users/jhsware/groksandbox/Prestatics/src/prestatics/
configure.zcml", line 4.2-4.27
<grok:grok package="." />
21 feb 2008 kl. 20.56 skrev Philipp von Weitershausen:
> Sebastian Ware wrote:
>> In the traceback bellow. How do I figure out what the conflict is?
>
> By reading the traceback carefully ;). I admit, though, that the
> traceback is mostly geared towards ZCML currently and may be a bit
> misleading.
>
> There's actually a very straight-forward way of equipping the
> configuration machinery with the right information so that
> tracebacks look meaningful. We could use this so that the traceback
> would quote our Python code instead of some meaningless ZCML. This,
> however, will involve changing either Martian or the grokkers to
> annotate the configuration context with the information accordingly,
> which isn't always easy because I'm not sure if you can get this
> info from classes, for example (you *can* get it from function
> objects through their code objects). This is why I chickened out of
> it during the initial move towards configuration action, and left it
> for another day.
Mvh Sebastian
10 maj 2008 kl. 14.16 skrev Brandon Craig Rhodes:
> Sebastian Ware <sebastian at urbantalk.se> writes:
>
>> 9 maj 2008 kl. 15.19 skrev Peter Bengtsson:
>>
>>> In fact I think there are plenty other errors that could be
>>> "grokified" to better help junior developers (aka. "django users").
>>> Especially nasty are those that aren't pythonic where the last 20
>>> lines the traceback is about something in a ZCML file.
>>
>> I have had quite a number of those questions in the past... :) Let me
>> know if you want a listing of cases that I have run into.
>
> Yes, please! I'll start a branch today and begin writing tests.
>
> --
> Brandon Craig Rhodes brandon at rhodesmill.org http://rhodesmill.org/brandon
More information about the Grok-dev
mailing list