tepperly/MixDown — Issue #29: Syntax error in DependsOn field error message not meaningful to user
Author: lorin
Created: 2011-11-08 16:09:43+00:00
State: open

I used the wrong syntax in the DependsOn field in a MixDown file. Specifically, I did this:

DependsOn: zlib curl

That resulted in a Python stack trace that doesn't give the user any information about what went wrong:

MixDown - A tool to simplify building

Cleaning MixDown directories...
Traceback (most recent call last):
File "/Users/lorin/MixDown/MixDown", line 196, in
main()
File "/Users/lorin/MixDown/MixDown", line 55, in main
mdProject = setup(mdOptions)
File "/Users/lorin/MixDown/MixDown", line 155, in setup
if not mdProject.examine(mdOptions):
File "/Users/lorin/MixDown/md/project.py", line 76, in examine
self.__assignDepthToTargetList()
File "/Users/lorin/MixDown/md/project.py", line 261, in __assignDepthToTargetList
if currChildTarget.dependencyDepth < (currTarget.dependencyDepth + 1):
AttributeError: 'NoneType' object has no attribute 'dependencyDepth'

It would help to have a more meaningful error message to the user, so that they can fix their syntax errors.

In general, we should probably expect users to make syntax errors in the MixDown file, so the system try to make it clear that the problem is a syntax error in the file, and try to localize the error (e.g., "Error in line 4: ...") as much as is possible.