Skip to content
Permalink
Browse files

Add more auto formatted message for missing parameter

  • Loading branch information
pblottiere committed Mar 28, 2019
1 parent cac591c commit bdda3715c420294005772f00b326ecbdb1ee0501
Showing with 9 additions and 9 deletions.
  1. +8 −8 src/server/services/wms/qgswmsgetstyles.cpp
  2. +1 −1 src/server/services/wms/qgswmsrenderer.cpp
@@ -59,15 +59,15 @@ namespace QgsWms

if ( layersName.isEmpty() )
{
throw QgsBadRequestException( QStringLiteral( "LayerNotSpecified" ),
QStringLiteral( "Layers is mandatory for GetStyles operation" ) );
throw QgsBadRequestException( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE,
QgsWmsParameter::LAYERS );
}

QStringList layerList = layersName.split( ',', QString::SkipEmptyParts );
if ( layerList.isEmpty() )
{
throw QgsBadRequestException( QStringLiteral( "LayerNotSpecified" ),
QStringLiteral( "Layers is mandatory for GetStyles operation" ) );
throw QgsBadRequestException( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE,
QgsWmsParameter::LAYERS );
}

return getStyledLayerDescriptorDocument( serverIface, project, layerList );
@@ -96,14 +96,14 @@ namespace QgsWms

if ( styleName.isEmpty() )
{
throw QgsServiceException( QStringLiteral( "StyleNotSpecified" ),
QStringLiteral( "Style is mandatory for GetStyle operation" ), 400 );
throw QgsBadRequestException( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE,
QgsWmsParameter::STYLE );
}

if ( layerName.isEmpty() )
{
throw QgsServiceException( QStringLiteral( "LayerNotSpecified" ),
QStringLiteral( "Layer is mandatory for GetStyle operation" ), 400 );
throw QgsBadRequestException( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE,
QgsWmsParameter::LAYERS );
}

QStringList layerList;
@@ -132,7 +132,7 @@ namespace QgsWms
// check parameters
if ( mWmsParameters.allLayersNickname().isEmpty() )
throw QgsBadRequestException( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE,
QgsWmsParameter::LAYER );
QgsWmsParameter::LAYERS );

if ( mWmsParameters.format() == QgsWmsParameters::Format::NONE )
throw QgsBadRequestException( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE,

0 comments on commit bdda371

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