To test this inside of the Terminal, we'll start by rerunning the command with an address that's invalid:
node app.js -a 000000

When we run this command, we see that Unable to find address. prints to the screen. Instead of the program crashing, printing a bunch of errors, we simply have a little message printing to the screen. This is because the code we have in second else if statement, that tried to access those properties that didn't exist, no longer runs because our first else if condition gets caught and we simply print the message to the screen.
Now we also want to test that the first message (Unable to connect to the Google servers.) prints when it should. For this, we'll delete some part of the URl in our code, let's say, s and ., and save the file:
request({
url: `https://mapgoogleapis.com/maps/api/geocode/json?address=${encodedAddress}`,
json: true
}, (error, response, body) => {
if (error) {
console.log('Unable to connect Google servers.');
} else if (body.status === 'ZERO_RESULTS') {
console.log('Unable to find that address.');
} else if (body.status === 'OK') {
console.log(`Address: ${body.results[0].formatted_address}`);
console.log(`Latitude: ${body.results[0].geometry.location.lat}`);
console.log(`Longitude: ${body.results[0].geometry.location.lng}`);
}
});
Then we'll rerun the previous command in the Terminal. This time around we can see Unable to connect to Google servers. prints to the screen just like it should:

Now we can test it the final thing, by first readjusting the URL to make it correct, and then fetching a valid address from the Terminal. For example, we can use the node app.js, setting address equal to 08822, which is a zip code in New Jersey:
node app.js --address 08822
When we run this command, we do indeed get our formatted address for Flemington, NJ, with a zip code and the state, and we have our latitude and longitude as shown here:

We now have a complete error handling model. When we make a request to Google providing a address that has problems, in this case there's ZERO_RESULTS, the error object will get populated, because it's not technically an error in terms of what request thinks an error is, it's actually in the response object, which is why we have to use body.status in order to check the error.
That is it for this section, we now have error handling in place, we handle system errors, Google server errors, and we have our success case.