Menu Close

Error reporting

Don’t wake me up, but if a problem occurs that requires you to do so, at least include enough information so that I can fix it.

Coding at a low level means thinking about how your code could go wrong. All the possible ways an input could mess up your code.

A message comes in that causes the process to crash. Log what’s in the message; include it in the exception that you throw or the error you’re returning.

The difference between “a problem happened” and “here’s a message I can’t parse” is huge. With enough information in the exception, we may be able to automate the response and the need to wake anyone up goes away.

1 Comment

  1. Alan

    To give a specific example from just a few days after this was posted.

    I had a typo in a GCP Bucket Name. The error message I got was “failed to iterate through bucket objects:” and then the error that was returned from the underlying library. No mention of what bucket it was.

    I modified the error message to include the bucket name, and reran the pipeline, and immediately saw there was an A appended to the bucket name. I was then able to track that down quickly. I don’t know any reason it wasn’t there in the first place.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.