Skip to content

Commit

Permalink
[WFS provider] Accept 'code' attribute in ExceptionReport (fixes #42196)
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and nyalldawson committed May 21, 2021
1 parent 7a239f8 commit d1d3da1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/providers/wfs/qgswfsprovider.cpp
Expand Up @@ -1982,8 +1982,12 @@ void QgsWFSProvider::handleException( const QDomDocument &serverResponse )
if ( exceptionElem.tagName() == QLatin1String( "ExceptionReport" ) )
{
QDomElement exception = exceptionElem.firstChildElement( QStringLiteral( "Exception" ) );
// The XML schema at http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd uses
// the "exceptionCode" attribute, but http://docs.opengeospatial.org/is/04-094r1/04-094r1.html#36
// mentions "code". Accept both...
pushError( tr( "WFS exception report (code=%1 text=%2)" )
.arg( exception.attribute( QStringLiteral( "exceptionCode" ), tr( "missing" ) ),
.arg( exception.attribute( QStringLiteral( "exceptionCode" ),
exception.attribute( QStringLiteral( "code" ), tr( "missing" ) ) ),
exception.firstChildElement( QStringLiteral( "ExceptionText" ) ).text() )
);
return;
Expand Down

0 comments on commit d1d3da1

Please sign in to comment.