Skip to content

Commit 2db4f35

Browse files
committed
If a network request error occurs while reading the streamed GML, then return a failure status from the getFeatures method
1 parent 738b7e3 commit 2db4f35

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/core/qgsgml.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,22 @@ int QgsGml::getFeatures( const QString& uri, QGis::WkbType* wkbType, QgsRectangl
128128
QCoreApplication::processEvents();
129129
}
130130

131+
QNetworkReply::NetworkError replyError = reply->error();
132+
QString replyErrorString = reply->errorString();
133+
131134
delete reply;
132135
delete progressDialog;
133136

137+
if ( replyError )
138+
{
139+
QgsMessageLog::logMessage(
140+
tr( "GML Getfeature network request failed with error: %1" ).arg( replyErrorString ),
141+
tr( "Network" ),
142+
QgsMessageLog::CRITICAL
143+
);
144+
return 1;
145+
}
146+
134147
if ( *mWkbType != QGis::WKBNoGeometry )
135148
{
136149
if ( mExtent.isEmpty() )

0 commit comments

Comments
 (0)