Errors originating from the pymongo driver aren't properly propagated to the application.
For instance, when performing a geospatial query when there is no 2dsphere index on the collection, I get the following error:
File "/project/env/local/lib/python2.7/site-packages/pymongo/cursor.py", line 977, in next
if len(self.__data) or self._refresh():
File "/project/env/local/lib/python2.7/site-packages/pymongo/cursor.py", line 902, in _refresh
self.__read_preference))
File "/project/env/local/lib/python2.7/site-packages/pymongo/cursor.py", line 839, in __send_message
codec_options=self.__codec_options)
File "/project/env/local/lib/python2.7/site-packages/pymongo/helpers.py", line 112, in _unpack_response
error_object = bson.BSON(response[20:]).decode()
AttributeError: 'module' object has no attribute 'BSON'
When I disable cbson with:
os.environ['MONGOKAT_DISABLE_CBSON'] = "1"
I get the proper error:
File "/project/env/local/lib/python2.7/site-packages/pymongo/cursor.py", line 977, in next
if len(self.__data) or self._refresh():
File "/project/env/local/lib/python2.7/site-packages/pymongo/cursor.py", line 902, in _refresh
self.__read_preference))
File "/project/env/local/lib/python2.7/site-packages/pymongo/cursor.py", line 839, in __send_message
codec_options=self.__codec_options)
File "/project/env/local/lib/python2.7/site-packages/pymongo/helpers.py", line 122, in _unpack_response
error_object)
OperationFailure: database error: error processing query: ns=test_test.pl_venue ntoreturn=100
Tree: GEONEAR field=geolocation maxdist=100 isNearSphere=0
Sort: {}
Proj: {}
planner returned error: unable to find index for $geoNear query
requirements:
pymongo==3.0.3
mongokat==0.1.4
Errors originating from the pymongo driver aren't properly propagated to the application.
For instance, when performing a geospatial query when there is no 2dsphere index on the collection, I get the following error:
When I disable cbson with:
os.environ['MONGOKAT_DISABLE_CBSON'] = "1"I get the proper error:
requirements:
pymongo==3.0.3
mongokat==0.1.4