Uninteligible error messages
Quite often, the error messages from zope are not helpful (IMHO). For example, does anyone know why doing this in a python script: script.manage_addProperty("test","null/null/null","date") gives the error: AttributeError: SyntaxError instance has no attribute 'replace' But a differently-bad date, like this: script.manage_addProperty("test","null","date") gives the error: IndexError: string index out of range Neither of which is particularly helpful at diagnosing the error. Why can't it return something like "DateException could not convert string to date" Does this count as a bug that should go in collector? Robert (Jamie) Munro
jamie@textmatters.com wrote:
Quite often, the error messages from zope are not helpful (IMHO). For example, does anyone know why doing this in a python script:
script.manage_addProperty("test","null/null/null","date")
gives the error: AttributeError: SyntaxError instance has no attribute 'replace'
Yeah, that is odd, stick it in the collector...
But a differently-bad date, like this:
script.manage_addProperty("test","null","date")
gives the error: IndexError: string index out of range
Indeed.
Neither of which is particularly helpful at diagnosing the error. Why can't it return something like "DateException could not convert string to date"
Sometimes it does, but date parsing is pretty hairy in anyone's language ;-)
Does this count as a bug that should go in collector?
Probably... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
jamie@textmatters.com wrote at 2005-2-18 11:35 -0000:
... Neither of which is particularly helpful at diagnosing the error. Why can't it return something like "DateException could not convert string to date"
As a general rule: You do not diagnose an error based on the message alone. Instead, you take the traceback corresponding to the error into account! -- Dieter
participants (3)
-
Chris Withers -
Dieter Maurer -
jamieï¼ textmatters.com