Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[node] Throw on invalid style JSON #6151

Merged
merged 2 commits into from
Aug 25, 2016
Merged

Conversation

tmpsantos
Copy link
Contributor

Fixes #6143

@mention-bot
Copy link

@tmpsantos, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @mikemorris and @tmcw to be potential reviewers.

@mikemorris
Copy link
Contributor

mikemorris commented Aug 25, 2016

Hrm, it would be nice if map.load took a callback arg that it could pass an error to (I think it's actually async already despite the API design?) instead of needing to wrap this in a try/catch in implementing code...

That being said, this seems alright as there's already a possibility of throwing from this call.

@mikemorris mikemorris added the Node.js node-mapbox-gl-native label Aug 25, 2016
@tmpsantos
Copy link
Contributor Author

I think it's actually async already despite the API design?

The underlying Map::setStyleJSON so that makes map.load sync too. Note that the exception is thrown at https://github.com/mapbox/mapbox-gl-native/blob/8c2b185ce111cde7c87e588dde8fcdd1eb3e128b/platform/node/src/node_map.cpp#L207

@mikemorris
Copy link
Contributor

:shipit:

@tmpsantos tmpsantos force-pushed the tmpsantos-node_parse_exception branch from 8c2b185 to 05ba97b Compare August 25, 2016 19:05
@tmpsantos tmpsantos merged commit 05ba97b into master Aug 25, 2016
@tmpsantos tmpsantos deleted the tmpsantos-node_parse_exception branch August 25, 2016 19:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Node.js node-mapbox-gl-native
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants