If you wanted another example where good error handling in code could save some time, here's one -
Last week I was making some changes to a small process I've had for ages; the process was all working when I wanted to extract a small bit of information from the message and decided to use the XLANG/s xpath method to do so.
I planned to get the actual xpath string from a helper class (I always do, to help with maintenance), so I've create a variable for it, but as a temporary step I've put the xpath as the initialising value for the variable.
When trying to build the project I've received an error in the error list - "Unexpected EOF". not very useful.
This could have taken me ages to figure out, but luckily I knew the only thing I changed was adding that variable, so I changed the initialising value to TEST and tried to build; this time the error was much more meaningful -
"identifier 'TEST' does not exist in '<process name>'; are you missing an assembly reference?"
as well as -
"cannot find symbol 'TEST'
Just out of curiosity I tried again with the value of TEST THREE WORDS, this time it looked like
"identifier 'TEST' does not exist in '<process name>'; are you missing an assembly reference?"
and
"cannot find symbol 'TEST'
as well as
unexpected identifier: 'THREE'
and
expected ';'
So what do I make out of it -
To start with I should stop forgetting that the values for string variables should be provided in quotes
That having a single quote in a variable value results in the rather cryptic "Unexpected EOF" error
That BizTalk could have done slightly more to validate values of variables at design/compile time and save us developers precious time :-)
No comments:
Post a comment