Skip to content

Commit 3658c77

Browse files
author
mhugent
committed
Apply patch in ticket #2891 and some more verbose error reporting. Thanks strk
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13935 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a0b2822 commit 3658c77

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/plugins/wfs/qgswfssourceselect.cpp

+15-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void QgsWFSSourceSelect::populateConnectionList()
9090
QSettings s;
9191
QString selectedConnection = s.value( "/Qgis/connections-wfs/selected" ).toString();
9292
int index = cmbConnections->findText( selectedConnection );
93-
if( index != -1 )
93+
if ( index != -1 )
9494
{
9595
cmbConnections->setCurrentIndex( index );
9696
}
@@ -150,13 +150,24 @@ int QgsWFSSourceSelect::getCapabilitiesGET( QString uri, std::list<QString>& typ
150150
QgsHttpTransaction http( request );
151151
if ( !http.getSynchronously( result ) )
152152
{
153-
QMessageBox::critical( 0, tr( "Error" ), tr( "The capabilities document could not be retrieved from the server" ) );
153+
QMessageBox::critical( 0, tr( "Could not download capabilities document" ), http.errorString() );
154+
return 1;
154155
}
155156

156157
QDomDocument capabilitiesDocument;
157-
if ( !capabilitiesDocument.setContent( result, true ) )
158+
QString capabilitiesDocError;
159+
if ( !capabilitiesDocument.setContent( result, true, &capabilitiesDocError ) )
158160
{
159-
return 1; //error
161+
QMessageBox::critical( 0, tr( "Capabilities document is not valid" ), capabilitiesDocError );
162+
return 1;
163+
}
164+
165+
QDomNodeList exlist = capabilitiesDocument.elementsByTagName( "ExceptionText" );
166+
if ( exlist.length() )
167+
{
168+
QDomElement ex = exlist.at( 0 ).toElement();
169+
QMessageBox::critical( 0, tr( "Error" ), ex.firstChild().nodeValue() );
170+
return 1;
160171
}
161172

162173

0 commit comments

Comments
 (0)