Skip to content
Permalink
Browse files

Log WFS errors

  • Loading branch information
mhugent committed Jun 3, 2013
1 parent 1e2e481 commit cd353db1357cce6daf644b746b4b19741d0930ba
Showing with 12 additions and 4 deletions.
  1. +10 −1 src/core/qgsgml.cpp
  2. +2 −3 src/providers/wfs/qgswfsprovider.cpp
@@ -17,6 +17,7 @@
#include "qgscoordinatereferencesystem.h"
#include "qgsgeometry.h"
#include "qgslogger.h"
#include "qgsmessagelog.h"
#include "qgsnetworkaccessmanager.h"
#include <QBuffer>
#include <QList>
@@ -104,7 +105,15 @@ int QgsGml::getFeatures( const QString& uri, QGis::WkbType* wkbType, QgsRectangl
QByteArray readData = reply->readAll();
if ( readData.size() > 0 )
{
XML_Parse( p, readData.constData(), readData.size(), atEnd );
if ( XML_Parse( p, readData.constData(), readData.size(), atEnd ) == 0 )
{
XML_Error errorCode = XML_GetErrorCode( p );
QString errorString = tr( "Error: %1 on line %2, column %3" )
.arg( XML_ErrorString( errorCode ) )
.arg( XML_GetCurrentLineNumber( p ) )
.arg( XML_GetCurrentColumnNumber( p ) );
QgsMessageLog::instance()->logMessage( errorString, tr( "WFS" ) );
}
}
QCoreApplication::processEvents();
}
@@ -29,6 +29,7 @@
#include "qgswfsprovider.h"
#include "qgsspatialindex.h"
#include "qgslogger.h"
#include "qgsmessagelog.h"
#include "qgsnetworkaccessmanager.h"
#include "qgsogcutils.h"

@@ -93,9 +94,7 @@ QgsWFSProvider::QgsWFSProvider( const QString& uri )
if ( describeFeatureType( uri, mGeometryAttribute, mFields, mWKBType ) )
{
mValid = false;
QgsDebugMsg( QString( "describeFeatureType failed, URI=%1" ).arg( uri ) );
QMessageBox( QMessageBox::Warning, "DescribeFeatureType failed!",
QString( "Layer cannot be created from\n%1" ).arg( uri ) );
QgsMessageLog::instance()->logMessage( tr( "DescribeFeatureType failed for url %1" ).arg( uri ), tr( "WFS" ) );
return;
}

0 comments on commit cd353db

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