Something Rotten in the Core
&gt; We&#x27;ve seen it hundreds of times in all kinds of software. Functions that return bool instead of an error code. Where did the precise error vanish to? Poof, it&#x27;s gone!<p>A thousand times yes.<p>Earlier this year, two of us spent a full day debugging a problem with some of our automation. Our team has pretty good automation, for the most part, but this particular problem was in kind of a dark corner. A shell script in the automation would start up a process in the background, and then send commands to that process. The background process could be slow to start up at times, so to deal with this, the commands running in the foreground had long timeouts if any. Guess what happens if the background process dies?<p>Well, the shell script doesn&#x27;t care, that&#x27;s for sure, it wasn&#x27;t watching for error codes in background processes. It was a bit of an adventure following the path from the foreground commands to the missing background process, and finding the log files for the background process.<p>It&#x27;s one of the things I like about writing this quick-and-dirty automation in Go--the error handling is so <i>explicit</i> that you&#x27;ll usually end up with good logs explaining what went wrong and what the program was trying to do at the time. Much better than dealing with shell scripts. Shell scripts are quick to write but you&#x27;re often left in a bad position when they fail in unexpected ways, or even in expected ways.<p>(The actual bug we hunted down was traced to one missing line in a configuration file, but the problems with that piece of automation are far larger.)