axios.get(geocodeUrl).then((response) =>
{
if(response.data.status === 'ZERO_RESULTS')
{
throw new ERROR('Unable To Find That Address');
}
console.log(JSON.stringify(response.data, undefined ,2));
}).catch((e)=> {
if(e.code === 'ENOTFOUND')
{
console.log('Unable to contact api servers');
}
else {
console.log(e.message);
console.log("xyz");
}
});
It prints :
"Error is not defined"
instead of
"Unable to find that address".
xyz gets printed.
ERRORtoError.