w3c / geolocation

W3C Geolocation API
https://www.w3.org/TR/geolocation/
81 stars 56 forks source link

Harmonize error code for watchPosition() #95

Closed marcoscaceres closed 3 years ago

marcoscaceres commented 3 years ago

Speaking with @saschanaz, they suggested we could harmonize all engines to just return 0 when whatPosition() would results in an error. This change would only affect Firefox, as Chrome and Safari already return 0, but the spec could be updated to reflect this.

marcoscaceres commented 3 years ago

Gave this some thought... I think we should just fix Gecko and leave the spec be.

marcoscaceres commented 3 years ago

Reopening the issue after some further discussion with @saschanaz and @annevk.

marcoscaceres commented 3 years ago

The argument presented is that web developers could come to rely on 0 being returned synchronously, so we might as well standardize that.

However, I'd argue that we should only ever return 0 going forward for any/all error and continue to push developers to check the GeolocationPositionError.code to figure out what actually went wrong.