Skip to content

Commit

Permalink
also report provider errors when not debugging
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14281 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 25, 2010
1 parent 411c36b commit 65963bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -71,7 +71,6 @@ class QgsCPLErrorHandler
{
CPLPopErrorHandler();
}

};

QgsOgrProvider::QgsOgrProvider( QString const & uri )
Expand Down
20 changes: 9 additions & 11 deletions src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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;
}

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

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 65963bd

Please sign in to comment.