WrightonLabCSU / DRAM

Distilled and Refined Annotation of Metabolism: A tool for the annotation and curation of function for microbial and viral genomes
GNU General Public License v3.0
239 stars 50 forks source link

DatabaseHandler - missing database should raise an exception #209

Open gregvonkuster opened 1 year ago

gregvonkuster commented 1 year ago

In the DatabaseHandler, if the database is missing, a warning message is printed (https://github.com/WrightonLabCSU/DRAM/blob/master/mag_annotator/database_handler.py#L46-L51) but processing continues and ultimately status code 0 is returned from the caller upon exit, so jobs that should have failed assume success.

A better approach would be to raise an exception (e.g., https://github.com/WrightonLabCSU/DRAM/blob/master/mag_annotator/database_processing.py#L248) and return a non-zero exit code so that callers can appropriately handle it.

rmFlynn commented 1 year ago

I confess I agree, this is a fix whose time has come.