January 2018
Beginner
658 pages
13h 10m
English
For now, we can move on to the final thing which is error. As I just mentioned, the status code can reveal that an error occurred, but this is going to be an error on the Google servers. Maybe the Google servers have a syntax error and their program is crashing, maybe the data that you sent is invalid, for example, you sent an address that doesn't exist. These errors are going to become evident via the status code.
What the error argument contains is errors related to the process of making that HTTP request. For example, maybe the domain is wrong: if I delete s and the dot with go in the URL, in our code, I get a URL that most likely doesn't exist:
const request = require('request');request({ url: 'https://mapogleapis.com/maps/api/geocode/json?address=1301%20lombard%20street%20philadelphia', ...Read now
Unlock full access