Closed frafra closed 2 years ago
The only potential problem I see, is that the error message for an invalid geometry is a bit too generic.
shape('{"Type":"Bad_GeoJSON","a":2}')
would show AttributeError: 'NoneType' object has no attribute 'lower'
, which is not so great. An alternative would be to catch AttributeError
as an exception and write something like Invalid geometry
.
Instead of changing the tests, I changed the error handling in the code, and wrote a meaningful error message.
That seems good enough for me :)
Thanks, @frafra ! I couldn't find the time to fix the tests. I'm glad that you found the issue.
Work based on PR #272.