Skip to content
Permalink
Browse files

[MSSQL] Correctly raise errors to UI level

Backport of 22ed48f
  • Loading branch information
NathanW2 committed Jun 19, 2017
1 parent f98ec62 commit 921b46c3ff2bfd012afeefa07032760080d79e98
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/providers/mssql/qgsmssqlprovider.cpp
@@ -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() )
@@ -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;
}

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

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

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

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

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

@@ -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;
}

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

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

0 comments on commit 921b46c

Please sign in to comment.
You can’t perform that action at this time.