Skip to content
Permalink
Browse files

More descriptive error messages when arcgis rest calls fail

  • Loading branch information
nyalldawson committed Oct 17, 2018
1 parent 100a14e commit 724102563df5c11c51a60a5d3aed45034e681bfc
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/providers/arcgisrest/qgsarcgisrestutils.cpp
@@ -521,7 +521,15 @@ QVariantMap QgsArcGisRestUtils::queryServiceJSON( const QUrl &url, QString &erro
QgsDebugMsg( QStringLiteral( "Parsing error: %1" ).arg( err.errorString() ) );
return QVariantMap();
}
return doc.object().toVariantMap();
const QVariantMap res = doc.object().toVariantMap();
if ( res.contains( QStringLiteral( "error" ) ) )
{
const QVariantMap error = res.value( QStringLiteral( "error" ) ).toMap();
errorText = error.value( QStringLiteral( "message" ) ).toString();
errorTitle = QObject::tr( "Error %1" ).arg( error.value( QStringLiteral( "code" ) ).toString() );
return QVariantMap();
}
return res;
}

std::unique_ptr<QgsSymbol> QgsArcGisRestUtils::parseEsriSymbolJson( const QVariantMap &symbolData )

0 comments on commit 7241025

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