Failing gracefully

It occurs to me that a lot of my software could be improved greatly with better checks to ensure “graceful failing”. In general my programs expect input data to be formatted correctly, accession numbers to exist, URLs to return a page and so on. I think one skill of the bioinformatician is to know a wide range of data formats and ways in which they can cause failure. I do use Perl’s eval{} when I suspect problems in BioPerl scripts, but that’s about it really.

Any comments or tips in this area greatly appreciated.