In my view the isConnected function should ALWAYS return a boolean if the proximityManager is not defined. In case an exception comes up when running the internal isConnection function, the promise should be rejected with that exception because in this case the connect call was successful, but there is something else going on which is worth throwing.
KontaktModule.java additionally tests whether proximityManager != null so that BeaconProximityManager.java does not have to check for this anymore. Hence, only exceptions which are not related to manager objects not being initialised are rejected.
In my view the
isConnected
function should ALWAYS return a boolean if theproximityManager
is not defined. In case an exception comes up when running the internalisConnection
function, the promise should be rejected with that exception because in this case theconnect
call was successful, but there is something else going on which is worth throwing.KontaktModule.java
additionally tests whetherproximityManager != null
so thatBeaconProximityManager.java
does not have to check for this anymore. Hence, only exceptions which are not related to manager objects not being initialised are rejected.