Skip to content

Commit 22ed48f

Browse files
committed
[MSSQL] Correctly raise errors to UI level
1 parent a511ecd commit 22ed48f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/providers/mssql/qgsmssqlprovider.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ void QgsMssqlProvider::loadFields()
377377
// Get computed columns which need to be ignored on insert or update.
378378
if ( !query.exec( QStringLiteral( "SELECT name FROM sys.columns WHERE is_computed = 1 AND object_id = OBJECT_ID('[%1].[%2]')" ).arg( mSchemaName, mTableName ) ) )
379379
{
380-
QgsDebugMsg( query.lastError().text( ) );
380+
pushError( query.lastError().text( ) );
381381
return;
382382
}
383383

@@ -391,7 +391,7 @@ void QgsMssqlProvider::loadFields()
391391

392392
if ( !query.exec( QStringLiteral( "exec sp_columns @table_name = N'%1', @table_owner = '%2'" ).arg( mTableName, mSchemaName ) ) )
393393
{
394-
QgsDebugMsg( query.lastError().text( ) );
394+
pushError( query.lastError().text( ) );
395395
return;
396396
}
397397
if ( query.isActive() )
@@ -1312,7 +1312,7 @@ bool QgsMssqlProvider::changeGeometryValues( const QgsGeometryMap &geometry_map
13121312

13131313
if ( !query.prepare( statement ) )
13141314
{
1315-
QgsDebugMsg( query.lastError().text() );
1315+
pushError( query.lastError().text() );
13161316
return false;
13171317
}
13181318

@@ -1330,7 +1330,7 @@ bool QgsMssqlProvider::changeGeometryValues( const QgsGeometryMap &geometry_map
13301330

13311331
if ( !query.exec() )
13321332
{
1333-
QgsDebugMsg( query.lastError().text() );
1333+
pushError( query.lastError().text() );
13341334
return false;
13351335
}
13361336
}
@@ -1364,7 +1364,7 @@ bool QgsMssqlProvider::deleteFeatures( const QgsFeatureIds &id )
13641364

13651365
if ( !query.exec( statement ) )
13661366
{
1367-
QgsDebugMsg( query.lastError().text() );
1367+
pushError( query.lastError().text() );
13681368
return false;
13691369
}
13701370

@@ -1421,7 +1421,7 @@ bool QgsMssqlProvider::createSpatialIndex()
14211421

14221422
if ( !query.exec( statement ) )
14231423
{
1424-
QgsDebugMsg( query.lastError().text() );
1424+
pushError( query.lastError().text() );
14251425
return false;
14261426
}
14271427

@@ -1440,7 +1440,7 @@ bool QgsMssqlProvider::createAttributeIndex( int field )
14401440

14411441
if ( field < 0 || field >= mAttributeFields.size() )
14421442
{
1443-
QgsDebugMsg( "createAttributeIndex invalid index" );
1443+
pushError( "createAttributeIndex invalid index" );
14441444
return false;
14451445
}
14461446

@@ -1449,7 +1449,7 @@ bool QgsMssqlProvider::createAttributeIndex( int field )
14491449

14501450
if ( !query.exec( statement ) )
14511451
{
1452-
QgsDebugMsg( query.lastError().text() );
1452+
pushError( query.lastError().text() );
14531453
return false;
14541454
}
14551455

0 commit comments

Comments
 (0)