Handle Geolocation errors
A location request can fail for several normal reasons. This sample turns the error code into a message that helps the user decide what to do next.
What you will learn
- How to provide an error callback
- What the three standard error codes mean
- How to offer a fallback instead of retrying forever
No request has been made.
Error codes
1- Permission denied.
2- Position unavailable.
3- Request timed out.