
Starting a new project is exciting and writing code is fun but getting the system to work and/or figure out why it's not is also a big part of the job. When you're working with software that's large enough to have dependencies, basically meaning any real system, diagnosing issues goes something like this:
It looks like an easy method. It gets a list of sessions from a remote system and then pulls data out of the local system for each session. But how does it stand up to diagnosibility? Let's say we get a call from the support rep: "Hi. We're not getting any session data, and I'm not sure why. Can you take a look?" The big questions become:
Or error handling, like this:
By using this approach, we've gone a long way toward making these problems easier to identify and diagnose. So in the future, let's give ourselves an extra hour to work it through. A little more elbow grease in the short run will save us valuable time in the long run!
- Set up environment: IDE, source code client, language libraries, package manager.
- Check out source code.
- Hit the "compile and run" or "run" button. Watch errors spew through logs. Curse.
- Install appropriate versions of required libraries.
- Hit "run." Curse.
- Look at first error in logs. Go ask nearest coworker what "/my/special/config" is. Get magic file.
- Hit "run." Curse.
- Look at first error in logs. Go ask nearest coworker. Hear, "Gosh, I don't remember."
- Diagnose problem.
- Repeat.
- There should be enough logging to see where it failed.
- Errors should be unambiguous. Things like "a problem has occurred" or "bad HTTP response" are not helpful.

- Are there any sessions?
- Could we talk to the other system or is there a connection error being swallowed?
- Assuming the remote system has sessions, are we not finding them in the local system or not getting data from them?

