Skip to content

Commit

Permalink
[MSSQL] Correctly raise errors to UI level
Browse files Browse the repository at this point in the history
Backport of 22ed48f
  • Loading branch information
NathanW2 committed Jun 19, 2017
1 parent f98ec62 commit 921b46c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/providers/mssql/qgsmssqlprovider.cpp
Expand Up @@ -383,7 +383,7 @@ void QgsMssqlProvider::loadFields()
query.setForwardOnly( true );
if ( !query.exec( QString( "exec sp_columns @table_name = N'%1', @table_owner = '%2'" ).arg( mTableName, mSchemaName ) ) )
{
QgsDebugMsg( query.lastError().text( ) );
pushError( query.lastError().text( ) );
return;
}
if ( query.isActive() )
Expand Down Expand Up @@ -1296,7 +1296,7 @@ bool QgsMssqlProvider::changeGeometryValues( const QgsGeometryMap &geometry_map

if ( !query.prepare( statement ) )
{
QgsDebugMsg( query.lastError().text() );
pushError( query.lastError().text() );
return false;
}

Expand All @@ -1314,7 +1314,7 @@ bool QgsMssqlProvider::changeGeometryValues( const QgsGeometryMap &geometry_map

if ( !query.exec() )
{
QgsDebugMsg( query.lastError().text() );
pushError( query.lastError().text() );
return false;
}
}
Expand Down Expand Up @@ -1348,7 +1348,7 @@ bool QgsMssqlProvider::deleteFeatures( const QgsFeatureIds & id )

if ( !query.exec( statement ) )
{
QgsDebugMsg( query.lastError().text() );
pushError( query.lastError().text() );
return false;
}

Expand Down Expand Up @@ -1405,7 +1405,7 @@ bool QgsMssqlProvider::createSpatialIndex()

if ( !query.exec( statement ) )
{
QgsDebugMsg( query.lastError().text() );
pushError( query.lastError().text() );
return false;
}

Expand All @@ -1424,7 +1424,7 @@ bool QgsMssqlProvider::createAttributeIndex( int field )

if ( field < 0 || field >= mAttributeFields.size() )
{
QgsDebugMsg( "createAttributeIndex invalid index" );
pushError( "createAttributeIndex invalid index" );
return false;
}

Expand All @@ -1433,7 +1433,7 @@ bool QgsMssqlProvider::createAttributeIndex( int field )

if ( !query.exec( statement ) )
{
QgsDebugMsg( query.lastError().text() );
pushError( query.lastError().text() );
return false;
}

Expand Down

0 comments on commit 921b46c

Please sign in to comment.