I've implemented a new error handling functionality for NAnt expression
evaluator. It allows you to spot the expression errors more quickly and
gives you detailed information about the error itself.
A visual string of ^^^^^^^^^^^^^^ characters is used to underline the source
of an error.
I've attached some examples of new error messages.
The code is in CVS. I'm awaiting your comments.
1. I think that the code for ExpressionEvalBase.SafeConvert() and
ExpressionEvalBase.GetSimpleTypeName() could/should be reused in all places
where conversion is currently used. This isn't directly doable now, but
that's the idea.
2. I didn't know to produce line number and file name in the output, but
this should be easy to add because the whole magic of catching
ExpressionParseException and re-throwing BuildException happens in a single
place in PropertyDictionary.EvaluateEmbeddedExpressions() where "Location"
seems to be available. Can someone help me here?
3. I use exception messages with embedded newlines - this isn't the best
style but works. Does anyone have any better suggestions?
Get latest updates about Open Source Projects, Conferences and News.