isa-api icon indicating copy to clipboard operation
isa-api copied to clipboard

ISA Tab Validation Rule Exception Messaging

Open ptth222 opened this issue 5 months ago • 1 comments

In isatools\isatab\validate\rules\core.py in the "Rule" class in the "execute" method if a rule has an exception it is caught here as "e" and "e" is printed. I'm not sure what the intent was here, but simply printing "e" does not show the full traceback and is very limited. For instance, I had a rule that was throwing an exception because "Sample Name" was not in the dataframe, and "print(e)" simply prints "Sample Name". No indication of the rule that had an issue or what the exception was, just "Sample Name". I feel that this should be more informative, but it isn't clear to me what the best solution would be. Some things are logged and some are printed, and I'm not sure exactly what the modus operandi is here.

For me personally, I would like a message that gave information about: the rule with the exception, the name of the study or assay with the issue, and the full traceback. You can use the "traceback" library and print the full traceback with "print(traceback.format_exc())".

ptth222 avatar Jan 23 '24 06:01 ptth222

+1 we ran into similar issues when @terazus performed a significant refactoring of the code base. I guess at the time, it was thought it was a good idea to keep the error log 'compact' but at the expense of being less informative It is on our list.

proccaserra avatar Jan 23 '24 09:01 proccaserra