Skip to content
Permalink
Browse files
also report provider errors when not debugging
git-svn-id: http://svn.osgeo.org/qgis/trunk@14281 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 25, 2010
1 parent da2cfb8 commit ff198a85d108832bac47370b57d734a80a7d6e55
Showing with 10 additions and 13 deletions.
  1. +1 −2 src/providers/ogr/qgsogrprovider.cpp
  2. +9 −11 src/providers/postgres/qgspostgresprovider.cpp
@@ -58,7 +58,7 @@ class QgsCPLErrorHandler
{
static void CPL_STDCALL showError( CPLErr errClass, int errNo, const char *msg )
{
QgsDebugMsg( QString( "OGR[%1] error %2: %3" ).arg( errClass ).arg( errNo ).arg( msg ) );
QgsLogger::warning( QString( "OGR[%1] error %2: %3" ).arg( errClass ).arg( errNo ).arg( msg ) );
}

public:
@@ -71,7 +71,6 @@ class QgsCPLErrorHandler
{
CPLPopErrorHandler();
}

};

QgsOgrProvider::QgsOgrProvider( QString const & uri )
@@ -623,7 +623,7 @@ bool QgsPostgresProvider::nextFeature( QgsFeature& feature )
QString fetch = QString( "fetch forward %1 from %2" ).arg( mFeatureQueueSize ).arg( cursorName );
if ( connectionRO->PQsendQuery( fetch ) == 0 ) // fetch features asynchronously
{
QgsDebugMsg( "PQsendQuery failed" );
QgsLogger::warning( "PQsendQuery failed" );
}

Result queryResult;
@@ -758,7 +758,7 @@ const QgsField &QgsPostgresProvider::field( int index ) const

if ( it == attributeFields.constEnd() )
{
QgsDebugMsg( "Field " + QString::number( index ) + " not found." );
QgsLogger::warning( "Field " + QString::number( index ) + " not found." );
throw PGFieldNotFound();
}

@@ -924,7 +924,7 @@ bool QgsPostgresProvider::loadFields()
}
else
{
QgsDebugMsg( "Field " + fieldName + " ignored, because of unsupported type " + fieldTypeName );
QgsLogger::warning( "Field " + fieldName + " ignored, because of unsupported type " + fieldTypeName );
continue;
}

@@ -943,7 +943,7 @@ bool QgsPostgresProvider::loadFields()
}
else
{
QgsDebugMsg( "Field " + fieldName + " ignored, because of unsupported type type " + fieldTType );
QgsLogger::warning( "Field " + fieldName + " ignored, because of unsupported type type " + fieldTType );
continue;
}

@@ -3307,13 +3307,11 @@ bool QgsPostgresProvider::Conn::PQexecNR( QString query )
if ( errorStatus == PGRES_COMMAND_OK )
return true;

#ifdef QGISDEBUG
QString err = QString( "Query: %1 returned %2 [%3]" )
.arg( query )
.arg( errorStatus )
.arg( QString::fromUtf8( PQresultErrorMessage( res ) ) );
QgsDebugMsg( err );
#endif
QgsLogger::warning( QString( "Query: %1 returned %2 [%3]" )
.arg( query )
.arg( errorStatus )
.arg( QString::fromUtf8( PQresultErrorMessage( res ) ) ) );

if ( openCursors )
{
QgsPostgresProvider::showMessageBox(

0 comments on commit ff198a8

Please sign in to comment.