fully implemented error handling for challenge 1

This commit is contained in:
Joaquin committed 2025-05-14 09:37:09 -07:00
1 parent 8166245ab1
commit 5e2ac94212
1 file changed
+10 -2
+10 -2
View File
@@ -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);
}