Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Apply patch in ticket #2891 and some more verbose error reporting. Th…
…anks strk

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13935 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jul 19, 2010
1 parent a0b2822 commit 3658c77
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/plugins/wfs/qgswfssourceselect.cpp
Expand Up @@ -90,7 +90,7 @@ void QgsWFSSourceSelect::populateConnectionList()
QSettings s;
QString selectedConnection = s.value( "/Qgis/connections-wfs/selected" ).toString();
int index = cmbConnections->findText( selectedConnection );
if( index != -1 )
if ( index != -1 )
{
cmbConnections->setCurrentIndex( index );
}
Expand Down Expand Up @@ -150,13 +150,24 @@ int QgsWFSSourceSelect::getCapabilitiesGET( QString uri, std::list<QString>& typ
QgsHttpTransaction http( request );
if ( !http.getSynchronously( result ) )
{
QMessageBox::critical( 0, tr( "Error" ), tr( "The capabilities document could not be retrieved from the server" ) );
QMessageBox::critical( 0, tr( "Could not download capabilities document" ), http.errorString() );
return 1;
}

QDomDocument capabilitiesDocument;
if ( !capabilitiesDocument.setContent( result, true ) )
QString capabilitiesDocError;
if ( !capabilitiesDocument.setContent( result, true, &capabilitiesDocError ) )
{
return 1; //error
QMessageBox::critical( 0, tr( "Capabilities document is not valid" ), capabilitiesDocError );
return 1;
}

QDomNodeList exlist = capabilitiesDocument.elementsByTagName( "ExceptionText" );
if ( exlist.length() )
{
QDomElement ex = exlist.at( 0 ).toElement();
QMessageBox::critical( 0, tr( "Error" ), ex.firstChild().nodeValue() );
return 1;
}


Expand Down

0 comments on commit 3658c77

Please sign in to comment.