-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Consider catching exceptions in io.ascii readers and raising as InconsistentTableError #3346
Description
Currently in the guessing process there are four exceptions that are handled in a failed read attempt: core.InconsistentTableError, ValueError, TypeError, AttributeError. The last one was added in #3342 to fix a problem with tables that almost look like DAOphot.
A different way to approach this is to pro-actively catch expected parsing errors in the various readers and re-raise as InconsistentTableError or possibly subclasses there-of. This would have the benefit of forcing scrutiny of the various failure paths and then providing users with better feedback for what went wrong. This would be immediately beneficial in the no-guess case. It could also be useful for guessing since we might provide a mode to print out the exception message for each guess try. Currently this isn't that useful since the exceptions are not always something that the user can make sense of.