@@ -284,7 +284,7 @@ namespace QgsWms
284
284
const QString templateName = mWmsParameters .composerTemplate ();
285
285
if ( templateName.isEmpty () )
286
286
{
287
- throw QgsBadRequestException ( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE ,
287
+ throw QgsBadRequestException ( QgsServiceException::QGIS_MissingParameterValue ,
288
288
QgsWmsParameter::TEMPLATE );
289
289
}
290
290
@@ -293,14 +293,14 @@ namespace QgsWms
293
293
QgsPrintLayout *sourceLayout ( dynamic_cast <QgsPrintLayout *>( lManager->layoutByName ( templateName ) ) );
294
294
if ( !sourceLayout )
295
295
{
296
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
296
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
297
297
mWmsParameters [QgsWmsParameter::TEMPLATE ] );
298
298
}
299
299
300
300
// Check that layout has at least one page
301
301
if ( sourceLayout->pageCollection ()->pageCount () < 1 )
302
302
{
303
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
303
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
304
304
QStringLiteral ( " The template has no pages" ) );
305
305
}
306
306
@@ -315,14 +315,14 @@ namespace QgsWms
315
315
if ( !atlas || !atlas->enabled () )
316
316
{
317
317
// error
318
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
318
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
319
319
QStringLiteral ( " The template has no atlas enabled" ) );
320
320
}
321
321
322
322
QgsVectorLayer *cLayer = atlas->coverageLayer ();
323
323
if ( !cLayer )
324
324
{
325
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
325
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
326
326
QStringLiteral ( " The atlas has no coverage layer" ) );
327
327
}
328
328
@@ -333,7 +333,7 @@ namespace QgsWms
333
333
atlas->updateFeatures ();
334
334
if ( atlas->count () > maxAtlasFeatures )
335
335
{
336
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
336
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
337
337
QString ( " The project configuration allows printing maximum %1 atlas features at a time" ).arg ( maxAtlasFeatures ) );
338
338
}
339
339
}
@@ -353,14 +353,14 @@ namespace QgsWms
353
353
int nAtlasFeatures = atlasPk.size () / pkIndexes.size ();
354
354
if ( nAtlasFeatures * pkIndexes.size () != atlasPk.size () ) // Test is atlasPk.size() is a multiple of pkIndexes.size(). Bail out if not
355
355
{
356
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
356
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
357
357
QStringLiteral ( " Wrong number of ATLAS_PK parameters" ) );
358
358
}
359
359
360
360
// number of atlas features might be restricted
361
361
if ( nAtlasFeatures > maxAtlasFeatures )
362
362
{
363
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
363
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
364
364
QString ( " %1 atlas features have been requestet, but the project configuration only allows printing %2 atlas features at a time" )
365
365
.arg ( nAtlasFeatures ).arg ( maxAtlasFeatures ) );
366
366
}
@@ -526,7 +526,7 @@ namespace QgsWms
526
526
}
527
527
else // unknown format
528
528
{
529
- throw QgsBadRequestException ( QgsServiceException::OGC_INVALID_FORMAT ,
529
+ throw QgsBadRequestException ( QgsServiceException::OGC_InvalidFormat ,
530
530
mWmsParameters [QgsWmsParameter::FORMAT] );
531
531
}
532
532
@@ -846,15 +846,15 @@ namespace QgsWms
846
846
{
847
847
QgsWmsParameter param ( QgsWmsParameter::I );
848
848
param.mValue = i;
849
- throw QgsBadRequestException ( QgsServiceException::OGC_INVALID_POINT ,
849
+ throw QgsBadRequestException ( QgsServiceException::OGC_InvalidPoint ,
850
850
param );
851
851
}
852
852
853
853
if ( j < 0 || j > mapSettings.outputSize ().height () )
854
854
{
855
855
QgsWmsParameter param ( QgsWmsParameter::J );
856
856
param.mValue = j;
857
- throw QgsBadRequestException ( QgsServiceException::OGC_INVALID_POINT ,
857
+ throw QgsBadRequestException ( QgsServiceException::OGC_InvalidPoint ,
858
858
param );
859
859
}
860
860
@@ -870,7 +870,7 @@ namespace QgsWms
870
870
// The QUERY_LAYERS parameter is Mandatory
871
871
if ( mWmsParameters .queryLayersNickname ().isEmpty () )
872
872
{
873
- throw QgsBadRequestException ( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE ,
873
+ throw QgsBadRequestException ( QgsServiceException::QGIS_MissingParameterValue ,
874
874
mWmsParameters [QgsWmsParameter::QUERY_LAYERS] );
875
875
}
876
876
@@ -887,13 +887,13 @@ namespace QgsWms
887
887
if ( mWmsParameters .j ().isEmpty () )
888
888
parameter = mWmsParameters [QgsWmsParameter::J];
889
889
890
- throw QgsBadRequestException ( QgsServiceException::QGIS_MISSING_PARAMETER_VALUE , parameter );
890
+ throw QgsBadRequestException ( QgsServiceException::QGIS_MissingParameterValue , parameter );
891
891
}
892
892
893
893
const QgsWmsParameters::Format infoFormat = mWmsParameters .infoFormat ();
894
894
if ( infoFormat == QgsWmsParameters::Format::NONE )
895
895
{
896
- throw QgsBadRequestException ( QgsServiceException::OGC_INVALID_FORMAT ,
896
+ throw QgsBadRequestException ( QgsServiceException::OGC_InvalidFormat ,
897
897
mWmsParameters [QgsWmsParameter::INFO_FORMAT] );
898
898
}
899
899
@@ -970,7 +970,7 @@ namespace QgsWms
970
970
QgsRectangle mapExtent = mWmsParameters .bboxAsRectangle ();
971
971
if ( !mWmsParameters .bbox ().isEmpty () && mapExtent.isEmpty () )
972
972
{
973
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
973
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
974
974
mWmsParameters [QgsWmsParameter::BBOX] );
975
975
}
976
976
@@ -1001,12 +1001,12 @@ namespace QgsWms
1001
1001
1002
1002
if ( width <= 0 )
1003
1003
{
1004
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
1004
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
1005
1005
mWmsParameters [QgsWmsParameter::WIDTH] );
1006
1006
}
1007
1007
else if ( height <= 0 )
1008
1008
{
1009
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
1009
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
1010
1010
mWmsParameters [QgsWmsParameter::HEIGHT] );
1011
1011
}
1012
1012
@@ -1054,7 +1054,7 @@ namespace QgsWms
1054
1054
QgsRectangle mapExtent = mWmsParameters .bboxAsRectangle ();
1055
1055
if ( !mWmsParameters .bbox ().isEmpty () && mapExtent.isEmpty () )
1056
1056
{
1057
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
1057
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
1058
1058
mWmsParameters [QgsWmsParameter::BBOX] );
1059
1059
}
1060
1060
@@ -1080,12 +1080,12 @@ namespace QgsWms
1080
1080
1081
1081
if ( mWmsParameters .versionAsNumber () >= QgsProjectVersion ( 1 , 3 , 0 ) )
1082
1082
{
1083
- code = QgsServiceException::OGC_INVALID_CRS ;
1083
+ code = QgsServiceException::OGC_InvalidCRS ;
1084
1084
parameter = mWmsParameters [ QgsWmsParameter::CRS ];
1085
1085
}
1086
1086
else
1087
1087
{
1088
- code = QgsServiceException::OGC_INVALID_SRS ;
1088
+ code = QgsServiceException::OGC_InvalidSRS ;
1089
1089
parameter = mWmsParameters [ QgsWmsParameter::SRS ];
1090
1090
}
1091
1091
@@ -1322,7 +1322,7 @@ namespace QgsWms
1322
1322
{
1323
1323
QgsWmsParameter param ( QgsWmsParameter::LAYER );
1324
1324
param.mValue = queryLayer;
1325
- throw QgsBadRequestException ( QgsServiceException::OGC_LAYER_NOT_DEFINED ,
1325
+ throw QgsBadRequestException ( QgsServiceException::OGC_LayerNotDefined ,
1326
1326
param );
1327
1327
}
1328
1328
else if ( ( validLayer && !queryableLayer ) || ( !validLayer && mContext .isValidGroup ( queryLayer ) ) )
@@ -1359,7 +1359,7 @@ namespace QgsWms
1359
1359
// Only throw if it's not a group or the group has no queryable children
1360
1360
if ( ! hasGroupAndQueryable )
1361
1361
{
1362
- throw QgsBadRequestException ( QgsServiceException::OGC_LAYER_NOT_QUERYABLE ,
1362
+ throw QgsBadRequestException ( QgsServiceException::OGC_LayerNotQueryable ,
1363
1363
param );
1364
1364
}
1365
1365
}
@@ -1897,7 +1897,7 @@ namespace QgsWms
1897
1897
int width = this ->width ();
1898
1898
if ( wmsMaxWidth != -1 && width > wmsMaxWidth )
1899
1899
{
1900
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
1900
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
1901
1901
QStringLiteral ( " The requested map width is too large" ) );
1902
1902
}
1903
1903
@@ -1919,7 +1919,7 @@ namespace QgsWms
1919
1919
int height = this ->height ();
1920
1920
if ( wmsMaxHeight != -1 && height > wmsMaxHeight )
1921
1921
{
1922
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
1922
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
1923
1923
QStringLiteral ( " The requested map height is too large" ) );
1924
1924
}
1925
1925
@@ -1948,7 +1948,7 @@ namespace QgsWms
1948
1948
|| std::numeric_limits<int >::max () / static_cast <uint>( bytes_per_line ) < static_cast <uint>( height )
1949
1949
|| std::numeric_limits<int >::max () / sizeof ( uchar * ) < static_cast <uint>( height ) )
1950
1950
{
1951
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
1951
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
1952
1952
QStringLiteral ( " The requested map size is too large" ) );
1953
1953
}
1954
1954
}
@@ -2778,7 +2778,7 @@ namespace QgsWms
2778
2778
QString errorMsg;
2779
2779
if ( !filterXml.setContent ( filter.mFilter , true , &errorMsg ) )
2780
2780
{
2781
- throw QgsBadRequestException ( QgsServiceException::QGIS_INVALID_PARAMETER_VALUE ,
2781
+ throw QgsBadRequestException ( QgsServiceException::QGIS_InvalidParameterValue ,
2782
2782
QStringLiteral ( " Filter string rejected. Error message: %1. The XML string was: %2" ).arg ( errorMsg, filter.mFilter ) );
2783
2783
}
2784
2784
QDomElement filterElem = filterXml.firstChildElement ();
@@ -2992,7 +2992,7 @@ namespace QgsWms
2992
2992
bool rc = layer->styleManager ()->setCurrentStyle ( style );
2993
2993
if ( ! rc )
2994
2994
{
2995
- throw QgsBadRequestException ( QgsServiceException::OGC_STYLE_NOT_DEFINED ,
2995
+ throw QgsBadRequestException ( QgsServiceException::OGC_StyleNotDefined ,
2996
2996
QStringLiteral ( " Style '%1' does not exist for layer '%2'" ).arg ( style, layer->name () ) );
2997
2997
}
2998
2998
}
0 commit comments