Skip to content
Permalink
Browse files
[WFS provider] Use ows:ExceptionReport for error message (fixes #42985)
  • Loading branch information
rouault authored and nyalldawson committed May 21, 2021
1 parent d3dfc64 commit b5c5cc756523bd656cf8c7f679d7f03c8c858257
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/providers/wfs/qgsbasenetworkrequest.cpp
@@ -448,6 +448,20 @@ void QgsBaseNetworkRequest::replyFinished()
else
{
mErrorMessage = errorMessageWithReason( mReply->errorString() );
QString replyContent = mReply->readAll();
QDomDocument exceptionDoc;
QString errorMsg;
if ( exceptionDoc.setContent( replyContent, true, &errorMsg ) )
{
QDomElement exceptionElem = exceptionDoc.documentElement();
if ( !exceptionElem.isNull() && exceptionElem.tagName() == QLatin1String( "ExceptionReport" ) )
{
QDomElement exception = exceptionElem.firstChildElement( QStringLiteral( "Exception" ) );
mErrorMessage = tr( "WFS exception report (code=%1 text=%2)" )
.arg( exception.attribute( QStringLiteral( "exceptionCode" ), tr( "missing" ) ),
exception.firstChildElement( QStringLiteral( "ExceptionText" ) ).text() );
}
}
mErrorCode = QgsBaseNetworkRequest::ServerExceptionError;
logMessageIfEnabled();
mResponse.clear();

0 comments on commit b5c5cc7

Please sign in to comment.