From 5e2ac9421258a21e1bd43f106c8b2c7a5a8d5c6e Mon Sep 17 00:00:00 2001 From: Joaquin Date: Wed, 14 May 2025 09:37:09 -0700 Subject: [PATCH] fully implemented error handling for challenge 1 --- src/public/scripts/geolocation.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/public/scripts/geolocation.js b/src/public/scripts/geolocation.js index 8dad938..7a96166 100644 --- a/src/public/scripts/geolocation.js +++ b/src/public/scripts/geolocation.js @@ -69,10 +69,18 @@ async function getLatestExchange(position) { let lon = position.coords.longitude; const res = await fetch(`/exRates/${lat}/${lon}`); const data = await res.json(); - + update(data); } function error(err) { - console.error("Geolocation error: ", err); + const data = { + data: { + message: "error" + } + } + + console.log(data); + + update(data); } \ No newline at end of file