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

Ensure we always emit "error" events instead of throwing errors #3208

Closed
jfirebaugh opened this issue Sep 16, 2016 · 2 comments
Closed

Ensure we always emit "error" events instead of throwing errors #3208

jfirebaugh opened this issue Sep 16, 2016 · 2 comments
Assignees

Comments

@jfirebaugh
Copy link
Contributor

If queryRenderedFeatures is passed an invalid filter, it throws. If it's passed an invalid layer ID (one that doesn't exist in the style), it emits an error event.

Is there a reason these two errors are reported differently or can we use a consistent error reporting mechanism?

cc @mollymerp @lucaswoj

@lucaswoj
Copy link
Contributor

We have decided to always emit, not throw, errors.

@lucaswoj lucaswoj changed the title Make error handling for queryRenderedFeatures consistent Ensure we always emit "error" events instead of throwing errors Sep 16, 2016
@lucaswoj
Copy link
Contributor

We should entirely remove the "throws" branch in this code https://github.com/mapbox/mapbox-gl-js/blob/b3bffe06564dcd031feeba715bd80de36e94f990/js/style/style.js#L689-L690

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

No branches or pull requests

2 participants