-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
RGeo::GeoJSON.decode
no longer returns nil
on invalid String input
#63
Comments
It is intended to go in this direction, as we already have a mixed API between different tools in the rgeo libs. The idea is to normalize raising. With that said, the PR dedicated to this is still open. So this is a bug, but I don't think we'll fix this now but rather try to close the other PR making failing a default. WDYT @keithdoggett ? Otherwise, if you think it is important feeling this gap for the time being, would you like to open a PR @tie-ioki ? |
Nah, the change isn't any problem, but with this being intended I'd like a little more note of it. The changelog just reads
but that implying that the comment above the method proclaiming |
I wasn't clear sorry. The intended change was to switch to multi-json and only that at the time. This introduced the bug you spotted (raising rather than returning nil). Today, we want a general policy of raising in case of error in RGeo's public APIs (including rgeo-geojson). So this will be a feature. And when it will be a feature, it will never return |
Ah I see alright, thank you! In this case I think this issue can be closed once you move over to raising wholesale. |
Hi y'all,
as of 2.2.0 the comment in
RGeo::GeoJSON::Coder
is no longer accurate. When using invalid String input, it used to returnnil
, but now raises aMultiJson::ParseError
. This can easily be tested by just callingRGeo::GeoJSON.decode('foo')
. The issue goes away when reverting the change fromJSON.parse
toMultiJson.load
.Is this behavior change intended? If so, the comment should probably be adjusted.
The text was updated successfully, but these errors were encountered: