What type of error does Location.getCurrentPositionAsync rejects the Promise with?

#1

Expo documentation does a very poor job at indicating the type of error the expo Location module could reject a promise with. For example getCurrentPositionAsync is an async function that could reject with an error more specifically here

But the type of error is completely unknown or at least I can’t really point my finger as to what type of error this promise will reject with. Is it a javascript native LocationError? Can someone please clarify?

0 Likes

#2

It’s likely not a PositionError. For questions like these that you can’t find in the documentation, the source code is the best place to look:

Android: https://github.com/expo/expo/blob/master/android/expoview/src/main/java/versioned/host/exp/exponent/modules/api/LocationModule.java
iOS: https://github.com/expo/expo/blob/master/ios/Exponent/Versioned/Modules/Api/EXLocation.m
JS: https://github.com/expo/expo-sdk/blob/master/src/Location.js

1 Like