mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Apply patch in ticket #2891 and some more verbose error reporting. Thanks strk
git-svn-id: http://svn.osgeo.org/qgis/trunk@13935 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
522a841d03
commit
a0c29c5ba9
@ -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 );
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user