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

Better error if no destionationXCoordinate or destinationYCoordinate #22

Open
gavinr opened this issue May 10, 2020 · 1 comment
Open

Comments

@gavinr
Copy link

gavinr commented May 10, 2020

If you don't have a valid X or Y in your data (for example, if one of them is empty/blank), you get a weird error, Uncaught TypeError: Cannot read property 'clone' of null. I know it's up to me as a user of the library to make sure I have good data, BUT in the case I don't for whatever reason, would be nice to have a more instructive error message.

I think this can be done by wrapping these lines in a classic .hasOwnProperty(). This might be a bit verbose though ... what do you think?

@jwasilgeo
Copy link
Owner

Thanks, @gavinr, I think that's a good error handling enhancement. Maybe wrap it up in a try/catch, too? Regardless, I could see it providing the error somehow in the console to try to inform which incoming feature row is not quite right, but still let the forEach loop continue with any other valid features. PRs welcome! 😉

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

2 participants