Catch some more exceptions from libspatialindex

This commit is contained in:
Nyall Dawson 2025-09-16 08:37:47 +10:00
parent 8bd5725e91
commit 01807ea142

View File

@ -126,7 +126,25 @@ class QgsGenericSpatialIndex
const SpatialIndex::Region r = QgsSpatialIndexUtils::rectangleToRegion( bounds );
const QMutexLocker locker( &mMutex );
mRTree->intersectsWithQuery( r, visitor );
try
{
mRTree->intersectsWithQuery( r, visitor );
}
catch ( Tools::Exception &e )
{
Q_UNUSED( e )
QgsDebugError( QStringLiteral( "Tools::Exception caught in QgsGenericSpatialIndex::intersects: %1" ).arg( e.what().c_str() ) );
}
catch ( const std::exception &e )
{
Q_UNUSED( e )
QgsDebugError( QStringLiteral( "std::exception caught in QgsGenericSpatialIndex::intersects: %1" ).arg( e.what() ) );
}
catch ( ... )
{
QgsDebugError( QStringLiteral( "unknown spatial index exception caught in QgsGenericSpatialIndex::intersects" ) );
}
return true;
}