Permalink
Browse files

PositionError must be an object, not string

Summary:
As specifications says, the Position error must be an object with code and message attributes. Right now it is a string. If not, we can't know what kind of error is. Another issue is that the message must be exactly "No available location provider."

Specifications:
https://developer.mozilla.org/en/docs/Web/API/PositionError
Closes #13140

Differential Revision: D4774922

Pulled By: ericvicenti

fbshipit-source-id: f956af051461e9f8d6435496283e54b3c4dc8ef5
  • Loading branch information...
dabit1 authored and facebook-github-bot committed Mar 25, 2017
1 parent 27c3e32 commit 94d93f7d41365cbcdddf36b1a9c0bcd8ec2fd325
@@ -123,7 +123,7 @@ public void getCurrentPosition(
(LocationManager) getReactApplicationContext().getSystemService(Context.LOCATION_SERVICE);
String provider = getValidProvider(locationManager, locationOptions.highAccuracy);
if (provider == null) {
error.invoke("No available location provider.");
emitError(PositionError.PERMISSION_DENIED, "No location provider available.");
return;
}
Location location = locationManager.getLastKnownLocation(provider);

0 comments on commit 94d93f7

Please sign in to comment.