polyvertex / fitdecode

A FIT file parsing and decoding library written in Python3
MIT License
158 stars 34 forks source link

Add error handling to _read_header #31

Open charlieforward9 opened 5 months ago

charlieforward9 commented 5 months ago

This is more of a sloppy workaround than a fix. Trying to get the parser to work on 3k files with intermittent bad headers without crashing. Attempts to address #30.

This code it will log a lot of warnings about not a FIT file @ X on files with bad headers and warn file truncated? expected Y bytes, got Z @ W.

I would love to find a great workaround but the FIT protocol is pretty dense and I code much more than I read right now...