Skip to content
Permalink
Browse files

[afs] Add error browser item when connection fails

  • Loading branch information
nyalldawson committed Jul 25, 2018
1 parent e3c7dff commit 5503af8b9174c2d25ae69b6012aac68864e7c0df
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/providers/arcgisrest/qgsafsdataitems.cpp
@@ -102,6 +102,13 @@ QVector<QgsDataItem *> QgsAfsConnectionItem::createChildren()
const QVariantMap serviceData = QgsArcGisRestUtils::getServiceInfo( url, errorTitle, errorMessage );
if ( serviceData.isEmpty() )
{
if ( !errorMessage.isEmpty() )
{
std::unique_ptr< QgsErrorItem > error = qgis::make_unique< QgsErrorItem >( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" );
error->setToolTip( errorMessage );
layers.append( error.release() );
QgsDebugMsg( "Connection failed - " + errorMessage );
}
return layers;
}
const QString authid = QgsArcGisRestUtils::parseSpatialReference( serviceData.value( QStringLiteral( "spatialReference" ) ).toMap() ).authid();

0 comments on commit 5503af8

Please sign in to comment.
You can’t perform that action at this time.