Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DFReader: add robust parsing #349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peterbarker
Copy link
Contributor

Throws exceptions in the parsing code, catches them and throws them away if required higher-up.

Will make the tool a little more fault tolerant if your log is slightly corrupt.

Copy link
Member

@OXINARF OXINARF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you decide which exceptions to catch? One of them is never caught and the two try/catch places don't catch the same ones - you might be right on this, but I didn't understand the choice.

@@ -64,6 +81,9 @@ def __init__(self, type, name, flen, format, columns, oldfmt=None):
self.unit_ids = None
self.mult_ids = None

if len(self.columns) != len(format):
raise(FormatColumnCountMismatch(format, columns))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me question the two lines below. Can we have a FMT message without format?

except BadFormatCharException as e:
if not self._robust_parsing:
raise e
m = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not continue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants