csc301-2023-fall / project-34-qeynet-inc-t

Repository for Astra, a U of T CSC301 team project developed for QEYnet.
MIT License
0 stars 1 forks source link

Better error handling for file reading #26

Open shape-warrior-t opened 9 months ago

shape-warrior-t commented 9 months ago

The current approach to handling errors and problems with inputted files is not a particularly careful one: simply catch whatever exceptions are raised and display them to the user, not distinguishing between expected exceptions caused by bad input and unexpected exceptions caused by bugs in the code.

In addition, some problems are currently not checked for, as far as I can tell:

I wrote astra/data/dict_parsing.py in the hopes that it could be helpful for parsing YAML/JSON data in a way that could give informative error information -- hopefully it can be of use when addressing some of this stuff.

For integration with the Problems tab: it's probably a good idea to switch from a "new data xor exception" model to a "zero or more pieces of new data and zero or more new errors" model. Some problems likely prevent further processing of data (for example, an unsupported file format), while others probably don't affect data processing at all and simply require raising warnings of other kinds (for example, if the gaps between timestamps suggest that there is a missing telemetry file, all the data from the current telemetry file can still be read in just fine).