Better error handling

master
Keith Irwin 2017-08-07 18:23:08 -04:00
parent 014a35d88e
commit dfc7a02e00
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
1 changed files with 13 additions and 2 deletions

View File

@ -107,8 +107,19 @@ if (!navigator.geolocation){
// Got error
function(err) {
alert("No geolocation position available!");
console.error(err);
console.error(err.message);
if (err.code==1) {
alert("You can't use this app without granting permission to access your location");
}
else if (err.code==2) {
alert("Location data not available.");
}
else if (err.code==3) {
alert("Timed out trying to determine location.");
}
else {
alert("An unknown error occured while trying to determine location.");
}
},
// Options