ipbus/ipbb

DepCmdParser in dev/master no longer reports errors

Closed this issue · 6 comments

I see that in the dev/master branch the DepCmdParser no longer reports parsing errors. This is due to the changes from

try:
    lParsedLine = self.parseLine(lLine.split())
except DepLineParserError as e:
    lMsg = "Error caught while parsing line {0} in file {1}".format(lLineNum, lDepFilePath) + "\n"
    lMsg += "Details - " + str(e) + ": '" + lLine + "'"
    raise RuntimeError(lMsg)

to

try:
    lParsedLine = self.parseLine(lLine.split())
except DepCmdParserError as lExc:
    lCurrentFile.errors.append((aPackage, aComponent, aDepFileName, lLineNr, lExc))
    continue

I'm not sure what exactly the intention is here (as in: is it really useful to continue parsing after an error has been encountered?), but in any case the errors should be reported somewhere.

Hi Jeroen,

Thanks for catching this problem.
The intention is to provide the user with a as-complete-as-possible list of parsing errors at the end of the parsing rather than stopping at the first one. This approach usually leads to a faster resolution of most of the errors in few iterations (instead of a long loop of fix-check-fix-check).

Alas, it seems that the final reporting of the parsing errors found by the parser doesn't work for you, is that right?
I'll give it a go when i'm back at work.

Hi Alessandro,

I'm fine with parsing as much as possible and then reporting all errors. At the moment I see (in the code) that the errors are collected along the way, but they are never reported at the end.

Cheers,
Jeroen

Bugger, that's not supposed to happen clearly.
I'll have a look ASAP

Should be fixed/better now. Can you have a look?

(bugfix/dep-error-reporting branch)

Looking better indeed. Now I can more easily find out what I messed up again ;-)

Thanks!
Jeroen