Skip to content
Permalink
Browse files

Update InvalidCRS / InvalidSRS exception according to the version

  • Loading branch information
pblottiere committed Mar 28, 2019
1 parent 2430d9c commit 5eca1f1bfd6ba0caaa9bd5fef885231e6d4f4985
Showing with 24 additions and 2 deletions.
  1. +15 −1 src/server/services/wms/qgswmsrenderer.cpp
  2. +9 −1 src/server/services/wms/qgswmsserviceexception.h
@@ -1064,7 +1064,21 @@ namespace QgsWms
outputCRS = QgsCoordinateReferenceSystem::fromOgcWmsCrs( crs );
if ( !outputCRS.isValid() )
{
throw QgsBadRequestException( QStringLiteral( "InvalidCRS" ), QStringLiteral( "Could not create output CRS" ) );
QgsServiceException::ExceptionCode code;
QgsWmsParameter parameter;

if ( mWmsParameters.versionAsNumber() >= QgsProjectVersion( 1, 3, 0 ) )
{
code = QgsServiceException::OGC_INVALID_CRS;
parameter = mWmsParameters[ QgsWmsParameter::CRS ];
}
else
{
code = QgsServiceException::OGC_INVALID_SRS;
parameter = mWmsParameters[ QgsWmsParameter::SRS ];
}

throw QgsBadRequestException( code, parameter );
}

//then set destinationCrs
@@ -118,14 +118,22 @@ namespace QgsWms
break;
}
case OGC_INVALID_SRS:
{
message = QStringLiteral( "The SRS is not valid." );
break;
}
case OGC_INVALID_CRS:
{
message = QStringLiteral( "The CRS is not valid." );
break;
}
case OGC_LAYER_NOT_DEFINED:
case OGC_STYLE_NOT_DEFINED:
case OGC_LAYER_NOT_QUERYABLE:
case OGC_CURRENT_UPDATE_SEQUENCE:
case OGC_INVALID_UPDATE_SEQUENCE:
case OGC_MISSING_DIMENSION_VALUE:
case OGC_INVALID_DIMENSION_VALUE:
case OGC_INVALID_CRS:
case OGC_OPERATION_NOT_SUPPORTED:
case QGIS_ERROR:
{

0 comments on commit 5eca1f1

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