Skip to content

Commit

Permalink
[afs] Add error browser item when connection fails
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 25, 2018
1 parent e3c7dff commit 5503af8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/providers/arcgisrest/qgsafsdataitems.cpp
Original file line number Diff line number Diff line change
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 5503af8

Please sign in to comment.