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

Add an error message for calling "GeoJSONSource#setData" for a style that doesn't exist #2602

Open
gertcuykens opened this issue May 22, 2016 · 3 comments

Comments

@gertcuykens
Copy link

gertcuykens commented May 22, 2016

Can this error message be improved?

(link removed)

Step 1) press the [+] button
Step 2) Notice the specific error message

dispatcher.js:32 Uncaught TypeError: Cannot read property 'send' of undefined

The dispatcher.js:32 that doesn't give any hints whatsoever for me and probably other api users.

@lucaswoj
Copy link
Contributor

The problem stems from calling GeoJSONSource#setData on a source who's style has been removed. We can and should add a better error message in this case.

@lucaswoj lucaswoj changed the title dispatcher.js:32 Uncaught TypeError: Cannot read property 'send' of undefined Add an error message for calling "GeoJSONSource#setData" for a style that doesn't exist May 23, 2016
@stepankuzmin
Copy link
Contributor

I've tried to reproduce this issue with v0.30.0, but it seems that there are no errors at all. Eg. setData on source after removing its style — http://jsbin.com/hohewax/edit?js,console,output

I'm not sure is it is a correct behavior or we should emit an error?

@gertcuykens
Copy link
Author

gertcuykens commented Jan 10, 2017

Definitely emit console message please, it's the only failsafe for users like me trying to be a concurrent worker smartass but have no idea they are just making a big race condition mess :) I can't think of any case where the programmer is not making a mistake when manipulating a style that already removed by some other worker?

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

No branches or pull requests

4 participants