Skip to content

Commit

Permalink
Fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
a-vorontsov committed Dec 30, 2019
1 parent 0b3d8bb commit 0d69d7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ const getLocalLatLng = async () => {
}
}

const latLngErrorHandle = (error) => {
if (error.code === "ENOTFOUND") {
const latLngErrorHandle = (err) => {
if (err.code === "ENOTFOUND") {
console.log(error("You are not connected to the internet."));
process.exit(1);
} else {
console.error(error);
console.error(err);
process.exit(1);
}
}
Expand Down Expand Up @@ -112,7 +112,7 @@ const getWeatherLatLng = async (lat, lng, forecast) => {
}
}

const cityErrorHandle = (error) => {
const cityErrorHandle = (err) => {
if (err.code === "ENOTFOUND") {
console.log(error("You are not connected to the internet."));
process.exit(1);
Expand Down

0 comments on commit 0d69d7a

Please sign in to comment.