2.0 Error Migration
React Native Nitro Geolocation 2.0 replaces the package's numeric error codes
with readable string discriminants. This change does not affect /compat, which
keeps the W3C-style numeric 1, 2, and 3 contract.
Update comparisons
Keep comparisons against LocationErrorCodes instead of copying either the old
number or the new string into application code:
The constants now carry their meaning in logs and serialized data:
Narrow unknown errors
JavaScript can throw any value. Use the exported guard when a catch boundary needs a trusted location code:
Migrate persisted errors
Do not reinterpret an old number as a new string. If an app stores API errors, translate known 1.x values once with the table above, write the 2.x string, and discard unknown values. The native Android background status store does this migration automatically for errors recorded by this package.
Keep /compat numeric
No change is required for code imported from
react-native-nitro-geolocation/compat:
Keeping the two contracts separate prevents the additional provider error codes from leaking into the browser-compatible surface.
