File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -1064,7 +1064,21 @@ namespace QgsWms
1064
1064
outputCRS = QgsCoordinateReferenceSystem::fromOgcWmsCrs ( crs );
1065
1065
if ( !outputCRS.isValid () )
1066
1066
{
1067
- throw QgsBadRequestException ( QStringLiteral ( " InvalidCRS" ), QStringLiteral ( " Could not create output CRS" ) );
1067
+ QgsServiceException::ExceptionCode code;
1068
+ QgsWmsParameter parameter;
1069
+
1070
+ if ( mWmsParameters .versionAsNumber () >= QgsProjectVersion ( 1 , 3 , 0 ) )
1071
+ {
1072
+ code = QgsServiceException::OGC_INVALID_CRS;
1073
+ parameter = mWmsParameters [ QgsWmsParameter::CRS ];
1074
+ }
1075
+ else
1076
+ {
1077
+ code = QgsServiceException::OGC_INVALID_SRS;
1078
+ parameter = mWmsParameters [ QgsWmsParameter::SRS ];
1079
+ }
1080
+
1081
+ throw QgsBadRequestException ( code, parameter );
1068
1082
}
1069
1083
1070
1084
// then set destinationCrs
Original file line number Diff line number Diff line change @@ -118,14 +118,22 @@ namespace QgsWms
118
118
break ;
119
119
}
120
120
case OGC_INVALID_SRS:
121
+ {
122
+ message = QStringLiteral ( " The SRS is not valid." );
123
+ break ;
124
+ }
125
+ case OGC_INVALID_CRS:
126
+ {
127
+ message = QStringLiteral ( " The CRS is not valid." );
128
+ break ;
129
+ }
121
130
case OGC_LAYER_NOT_DEFINED:
122
131
case OGC_STYLE_NOT_DEFINED:
123
132
case OGC_LAYER_NOT_QUERYABLE:
124
133
case OGC_CURRENT_UPDATE_SEQUENCE:
125
134
case OGC_INVALID_UPDATE_SEQUENCE:
126
135
case OGC_MISSING_DIMENSION_VALUE:
127
136
case OGC_INVALID_DIMENSION_VALUE:
128
- case OGC_INVALID_CRS:
129
137
case OGC_OPERATION_NOT_SUPPORTED:
130
138
case QGIS_ERROR:
131
139
{
You can’t perform that action at this time.
0 commit comments