Skip to content
Permalink
Browse files

Manage LayerNotDefined exception

  • Loading branch information
pblottiere committed Mar 28, 2019
1 parent 5eca1f1 commit 2fc3da3e7a64ca96cc816b501606c39f61cf507e
@@ -395,8 +395,10 @@ void QgsWmsRenderContext::searchLayersToRenderSld()
}
else
{
throw QgsBadRequestException( QStringLiteral( "LayerNotDefined" ),
QStringLiteral( "Layer \"%1\" does not exist" ).arg( lname ) );
QgsWmsParameter param( QgsWmsParameter::LAYER );
param.mValue = lname;
throw QgsBadRequestException( QgsServiceException::OGC_LAYER_NOT_DEFINED,
param );
}
}
}
@@ -439,8 +441,10 @@ void QgsWmsRenderContext::searchLayersToRenderStyle()
}
else
{
throw QgsBadRequestException( QStringLiteral( "LayerNotDefined" ),
QStringLiteral( "Layer \"%1\" does not exist" ).arg( nickname ) );
QgsWmsParameter param( QgsWmsParameter::LAYER );
param.mValue = nickname;
throw QgsBadRequestException( QgsServiceException::OGC_LAYER_NOT_DEFINED,
param );
}
}
}
@@ -1309,8 +1309,11 @@ namespace QgsWms
}
if ( !validLayer && !mContext.isValidLayer( queryLayer ) && !mContext.isValidGroup( queryLayer ) )
{
QString msg = QObject::tr( "Layer '%1' not found" ).arg( queryLayer );
throw QgsBadRequestException( QStringLiteral( "LayerNotDefined" ), msg );
QgsWmsParameter param( QgsWmsParameter::LAYER );
param.mValue = queryLayer;
throw QgsBadRequestException( QgsServiceException::OGC_LAYER_NOT_DEFINED,
param );

}
else if ( ( validLayer && !queryableLayer ) || ( !validLayer && mContext.isValidGroup( queryLayer ) ) )
{
@@ -128,6 +128,10 @@ namespace QgsWms
break;
}
case OGC_LAYER_NOT_DEFINED:
{
message = QStringLiteral( "The layer '%1' does not exist." ).arg( parameter.toString() );
break;
}
case OGC_STYLE_NOT_DEFINED:
case OGC_LAYER_NOT_QUERYABLE:
case OGC_CURRENT_UPDATE_SEQUENCE:

0 comments on commit 2fc3da3

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