Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added unavailability errors before all native methods #6874

Closed

Conversation

EvanBacon
Copy link
Contributor

No description provided.

@EvanBacon EvanBacon requested a review from ide January 28, 2020 06:49
@EvanBacon EvanBacon self-assigned this Jan 28, 2020
@@ -161,6 +161,9 @@ let googleApiKey;
const googleApiUrl = 'https://maps.googleapis.com/maps/api/geocode/json';

export async function getProviderStatusAsync(): Promise<ProviderStatus> {
if (!ExpoLocation.getProviderStatusAsync) {
throw new UnavailabilityError('expo-location', 'getProviderStatusAsync');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we want expo-location to be here?
Let's see at the error message of UnavailabilityError:

export class UnavailabilityError extends CodedError {
constructor(moduleName: string, propertyName: string) {
super(
'ERR_UNAVAILABLE',
`The method or property ${moduleName}.${propertyName} is not available on ${Platform.OS}, are you sure you've linked all the native dependencies properly?`
);
}
}

So it expects module's name instead of package's name 😉

@EvanBacon
Copy link
Contributor Author

Closing in favor of #6881

@EvanBacon EvanBacon closed this Jan 29, 2020
@EvanBacon EvanBacon deleted the @evanbacon/location/add-unavailability-errors branch January 29, 2020 22:33
@sjchmiela
Copy link
Contributor

#6881 isn't the approach we want to take, so I think this could be reopened/redone, sorry for raising false hopes! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants