Skip to content
Permalink
Browse files

Update exceptions for StyleNotDefined and LayerNotQueryable

  • Loading branch information
pblottiere committed Mar 28, 2019
1 parent 2fc3da3 commit 4c09957b5e3a42550c81f5213f60ac1335763f11
Showing with 12 additions and 7 deletions.
  1. +6 −5 src/server/services/wms/qgswmsrenderer.cpp
  2. +6 −2 src/server/services/wms/qgswmsserviceexception.h
@@ -1313,12 +1313,13 @@ namespace QgsWms
param.mValue = queryLayer;
throw QgsBadRequestException( QgsServiceException::OGC_LAYER_NOT_DEFINED,
param );

}
else if ( ( validLayer && !queryableLayer ) || ( !validLayer && mContext.isValidGroup( queryLayer ) ) )
{
QString msg = QObject::tr( "Layer '%1' is not queryable" ).arg( queryLayer );
throw QgsBadRequestException( QStringLiteral( "LayerNotQueryable" ), msg );
QgsWmsParameter param( QgsWmsParameter::LAYER );
param.mValue = queryLayer;
throw QgsBadRequestException( QgsServiceException::OGC_LAYER_NOT_QUERYABLE,
param );
}
}

@@ -3050,8 +3051,8 @@ namespace QgsWms
bool rc = layer->styleManager()->setCurrentStyle( style );
if ( ! rc )
{
throw QgsMapServiceException( QStringLiteral( "StyleNotDefined" ),
QStringLiteral( "Style \"%1\" does not exist for layer \"%2\"" ).arg( style, layer->name() ) );
throw QgsBadRequestException( QgsServiceException::OGC_STYLE_NOT_DEFINED,
QStringLiteral( "Style '%1' does not exist for layer '%2'" ).arg( style, layer->name() ) );
}
}

@@ -114,7 +114,7 @@ namespace QgsWms
}
case OGC_INVALID_FORMAT:
{
message = QStringLiteral( "The format %1 from %2 is not supported." ).arg( parameter.toString(), name );
message = QStringLiteral( "The format '%1' from %2 is not supported." ).arg( parameter.toString(), name );
break;
}
case OGC_INVALID_SRS:
@@ -132,8 +132,12 @@ namespace QgsWms
message = QStringLiteral( "The layer '%1' does not exist." ).arg( parameter.toString() );
break;
}
case OGC_STYLE_NOT_DEFINED:
case OGC_LAYER_NOT_QUERYABLE:
{
message = QStringLiteral( "The layer '%1' is not queryable." ).arg( parameter.toString() );
break;
}
case OGC_STYLE_NOT_DEFINED:
case OGC_CURRENT_UPDATE_SEQUENCE:
case OGC_INVALID_UPDATE_SEQUENCE:
case OGC_MISSING_DIMENSION_VALUE:

0 comments on commit 4c09957

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