how not to do error-handling

Currently working on a bug in an old VB6 system. The only thing we see in the logs is “Invalid use of Null”, which I know if the standard VB6 error you get when you try to access a value without checking to see if it’s null first. Since the system itself hasn’t changed in years, I know that, somewhere, in some table, there’s a null value where there shouldn’t be a null value. But, because the system doesn’t pass through the line # of the error, I can’t see which field it might be looking at. And, because it doesn’t pinpoint which record had the error, I can’t really tell which record it was processing when the error occurred. So, it could be any of about 100 different fields on any of about 100,000 different records. I’ve made an educated guess that it’s probably one of only a few different fields, and I think I’ve narrowed down the possible problem records too, but still, could I please ask anyone out there who may be writing non-trivial systems that may be in use long after they’ve left their company: If you’re going to “handle” exceptions, please do more than just eat them and report the error message! Please, for the love of god, at least report the line #. And, if you’re processing a large data set, give some indication of which record you were processing. Thank you.

Leave a Reply