Chapter 3.
Configuration and error handling
In this section of the book we’re going to do some housekeeping. We won’t add much new functionality, but instead focus on making improvements that’ll make it easier to manage our application as it grows.
You’ll learn how to:
- Set configuration settings for your application at runtime in an easy and idiomatic way using command-line flags.
- Improve your application log messages to include more information, and manage them differently depending on the type (or level) of log message.
- Make dependencies available to your handlers in a way that’s extensible, type-safe, and doesn’t get in the way when it comes to writing tests.
- Centralize error handling so that you don’t need to repeat yourself when writing code.