File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 19
19
#include " qgsgeometry.h"
20
20
#include " qgsfeature.h"
21
21
#include " qgsrect.h"
22
+ #include " qgslogger.h"
22
23
23
24
#include " SpatialIndex.h"
24
25
@@ -89,7 +90,7 @@ Tools::Geometry::Region QgsSpatialIndex::rectToRegion(QgsRect rect)
89
90
90
91
bool QgsSpatialIndex::featureInfo (QgsFeature& f, Tools::Geometry::Region& r, long & id)
91
92
{
92
- QgsGeometry* g = f.geometry ();
93
+ QgsGeometry * g = f.geometry ();
93
94
if (!g)
94
95
return false ;
95
96
@@ -105,8 +106,16 @@ bool QgsSpatialIndex::insertFeature(QgsFeature& f)
105
106
if (!featureInfo (f, r, id))
106
107
return false ;
107
108
108
- // TODO: handle possible exceptions
109
- mRTree ->insertData (0 ,0 , r, id);
109
+ // TODO: handle possible exceptions correctly
110
+ try {
111
+ mRTree ->insertData (0 ,0 , r, id);
112
+ } catch (Tools::Exception &e) {
113
+ QgsDebugMsg ( QString (" Tools::Exception caught: " ).arg (e.what ().c_str ()) );
114
+ } catch (const std::exception &e) {
115
+ QgsDebugMsg ( QString (" std::exception caught: " ).arg (e.what ()) );
116
+ } catch (...) {
117
+ QgsDebugMsg ( " unknown spatial index exception caught" );
118
+ }
110
119
111
120
return true ;
112
121
}
You can’t perform that action at this time.
0 commit comments