From 2db4f3515fbbb06d95388464523d45c0afee623e Mon Sep 17 00:00:00 2001 From: Jeremy Palmer Date: Sun, 30 Jun 2013 20:03:53 +1200 Subject: [PATCH] If a network request error occurs while reading the streamed GML, then return a failure status from the getFeatures method --- src/core/qgsgml.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/core/qgsgml.cpp b/src/core/qgsgml.cpp index 0ea0cf877be..f4477632e1a 100644 --- a/src/core/qgsgml.cpp +++ b/src/core/qgsgml.cpp @@ -128,9 +128,22 @@ int QgsGml::getFeatures( const QString& uri, QGis::WkbType* wkbType, QgsRectangl QCoreApplication::processEvents(); } + QNetworkReply::NetworkError replyError = reply->error(); + QString replyErrorString = reply->errorString(); + delete reply; delete progressDialog; + if ( replyError ) + { + QgsMessageLog::logMessage( + tr( "GML Getfeature network request failed with error: %1" ).arg( replyErrorString ), + tr( "Network" ), + QgsMessageLog::CRITICAL + ); + return 1; + } + if ( *mWkbType != QGis::WKBNoGeometry ) { if ( mExtent.isEmpty() )