@@ -59,15 +59,15 @@ namespace QgsWms
5959
6060 if ( layersName.isEmpty () )
6161 {
62- throw QgsBadRequestException ( QStringLiteral ( " LayerNotSpecified " ) ,
63- QStringLiteral ( " Layers is mandatory for GetStyles operation " ) );
62+ throw QgsBadRequestException ( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE ,
63+ QgsWmsParameter::LAYERS );
6464 }
6565
6666 QStringList layerList = layersName.split ( ' ,' , QString::SkipEmptyParts );
6767 if ( layerList.isEmpty () )
6868 {
69- throw QgsBadRequestException ( QStringLiteral ( " LayerNotSpecified " ) ,
70- QStringLiteral ( " Layers is mandatory for GetStyles operation " ) );
69+ throw QgsBadRequestException ( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE ,
70+ QgsWmsParameter::LAYERS );
7171 }
7272
7373 return getStyledLayerDescriptorDocument ( serverIface, project, layerList );
@@ -96,14 +96,14 @@ namespace QgsWms
9696
9797 if ( styleName.isEmpty () )
9898 {
99- throw QgsServiceException ( QStringLiteral ( " StyleNotSpecified " ) ,
100- QStringLiteral ( " Style is mandatory for GetStyle operation " ), 400 );
99+ throw QgsBadRequestException ( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE ,
100+ QgsWmsParameter::STYLE );
101101 }
102102
103103 if ( layerName.isEmpty () )
104104 {
105- throw QgsServiceException ( QStringLiteral ( " LayerNotSpecified " ) ,
106- QStringLiteral ( " Layer is mandatory for GetStyle operation " ), 400 );
105+ throw QgsBadRequestException ( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE ,
106+ QgsWmsParameter::LAYERS );
107107 }
108108
109109 QStringList layerList;
0 commit comments