Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[afs] Add error browser item when connection fails
(cherry-picked from 5503af8)
  • Loading branch information
nyalldawson committed Jul 25, 2018
1 parent a6650f4 commit 79b7084
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/providers/arcgisrest/qgsafsdataitems.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 79b7084

Please sign in to comment.