Take a watchPosition or getCurrentPosition, the second argument is the callback in case of failure, and its argument is the reason for its failure.
So, from there you know when and why it fails. You will need if if, for this reason, if you want to act only on a “disconnected location”, and not on a “wait time” request.
You can use a callback to add a flag to your state, for example.
source share