From 9f10c4f206b6d6f19e8a35c00bf47f348cdca4da Mon Sep 17 00:00:00 2001 From: Alan Boudreault Date: Tue, 29 May 2012 16:28:43 +0000 Subject: [PATCH] Fix wms_enable_request-related errors are not properly tagged (#4187) --- HISTORY.TXT | 2 ++ mapogcsos.c | 3 ++- mapwcs.c | 6 ++++-- mapwcs20.c | 4 ++-- mapwfs.c | 9 ++++++--- mapwms.c | 9 ++++++--- 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/HISTORY.TXT b/HISTORY.TXT index 8fcc2a99e7..0fc3eae4e9 100644 --- a/HISTORY.TXT +++ b/HISTORY.TXT @@ -14,6 +14,8 @@ For a complete change history, please see the Git log comments. Current Version (git master, 6.1-dev, future 6.2): ------------------------------------------------- +- Fix wms_enable_request-related errors are not properly tagged (#4187) + - Swig mapscript for multi-label support (#4310) - Fix creation of a vector symbolObj in mapscript (#4318) diff --git a/mapogcsos.c b/mapogcsos.c index 7251b1b9db..3229a5cfc0 100644 --- a/mapogcsos.c +++ b/mapogcsos.c @@ -1893,7 +1893,8 @@ int msSOSGetObservation(mapObj *map, sosParamsObj *sosparams, cgiRequestObj *req } if (i==map->numlayers) { - msSetError(MS_SOSERR, "Offering %s not found.", "msSOSGetObservation()", sosparams->pszOffering); + msSetError(MS_SOSERR, "Offering %s not found. A layer might be disabled for \ +this request. Check sos/ows_enable_request settings.", "msSOSGetObservation()", sosparams->pszOffering); return msSOSException(map, "offering", "InvalidParameterValue"); } diff --git a/mapwcs.c b/mapwcs.c index a0c1b7adbe..1abe4426e2 100644 --- a/mapwcs.c +++ b/mapwcs.c @@ -1378,7 +1378,8 @@ static int msWCSDescribeCoverage(mapObj *map, wcsParamsObj *params, owsRequestOb /* i = msGetLayerIndex(map, coverages[k]); */ if(i == map->numlayers) { /* coverage not found */ - msSetError( MS_WCSERR, "COVERAGE %s cannot be opened / does not exist", "msWCSDescribeCoverage()", coverages[k]); + msSetError( MS_WCSERR, "COVERAGE %s cannot be opened / does not exist. A layer might be disabled for \ +this request. Check wcs/ows_enable_request settings.", "msWCSDescribeCoverage()", coverages[k]); return msWCSException(map, "CoverageNotDefined", "coverage", params->version ); } } /* next coverage */ @@ -1652,7 +1653,8 @@ static int msWCSGetCoverage(mapObj *map, cgiRequestObj *request, } if(lp == NULL) { - msSetError( MS_WCSERR, "COVERAGE=%s not found, not in supported layer list.", "msWCSGetCoverage()", params->coverages[0] ); + msSetError( MS_WCSERR, "COVERAGE=%s not found, not in supported layer list. A layer might be disabled for \ +this request. Check wcs/ows_enable_request settings.", "msWCSGetCoverage()", params->coverages[0] ); return msWCSException(map, "InvalidParameterValue", "coverage", params->version); } diff --git a/mapwcs20.c b/mapwcs20.c index 6260f08b16..2c3c6dd87d 100644 --- a/mapwcs20.c +++ b/mapwcs20.c @@ -3522,8 +3522,8 @@ int msWCSGetCoverage20(mapObj *map, cgiRequestObj *request, if (layer == NULL) { msSetError(MS_WCSERR, - "COVERAGE=%s not found, not in supported layer list.", - "msWCSGetCoverage20()", params->ids[0]); + "COVERAGE=%s not found, not in supported layer list. A layer might be disabled for \ +this request. Check wcs/ows_enable_request settings.", "msWCSGetCoverage20()", params->ids[0]); return msWCSException(map, "InvalidParameterValue", "coverage", params->version); } diff --git a/mapwfs.c b/mapwfs.c index 754af36257..4717d79593 100644 --- a/mapwfs.c +++ b/mapwfs.c @@ -1153,7 +1153,8 @@ int msWFSDescribeFeatureType(mapObj *map, wfsParamsObj *paramsObj, owsRequestObj for (i=0; iindex, ows_request->enabled_layers, ows_request->numlayers)) ) { - msSetError(MS_WFSERR, "Invalid typename (%s).", "msWFSDescribeFeatureType()", layers[i]);/* paramsObj->pszTypeName); */ + msSetError(MS_WFSERR, "Invalid typename (%s). A layer might be disabled for \ +this request. Check wfs/ows_enable_request settings.", "msWFSDescribeFeatureType()", layers[i]);/* paramsObj->pszTypeName); */ return msWFSException(map, "typename", "InvalidParameterValue", paramsObj->pszVersion); } } @@ -2231,7 +2232,8 @@ int msWFSGetFeature(mapObj *map, wfsParamsObj *paramsObj, cgiRequestObj *req, ow for (i=0; ipszVersion); } psNode = FLTParseFilterEncoding(paszFilter[i]); @@ -2393,7 +2395,8 @@ int msWFSGetFeature(mapObj *map, wfsParamsObj *paramsObj, cgiRequestObj *req, ow if (k == map->numlayers)/*layer not found*/ { msSetError(MS_WFSERR, - "Invalid typename given with FeatureId in GetFeature : %s", "msWFSGetFeature()", + "Invalid typename given with FeatureId in GetFeature : %s. A layer might be disabled for \ +this request. Check wfs/ows_enable_request settings.", "msWFSGetFeature()", aFIDLayers[j]); if (aFIDLayers && aFIDValues) diff --git a/mapwms.c b/mapwms.c index a9abe388df..04315ac4c1 100644 --- a/mapwms.c +++ b/mapwms.c @@ -1484,7 +1484,8 @@ int msWMSLoadGetMapParams(mapObj *map, int nVersion, { if (invalidlayers > 0) { - msSetError(MS_WMSERR, "Invalid layer(s) given in the LAYERS parameter.", + msSetError(MS_WMSERR, "Invalid layer(s) given in the LAYERS parameter. A layer might be disabled for \ +this request. Check wms/ows_enable_request settings.", "msWMSLoadGetMapParams()"); return msWMSException(map, nVersion, "LayerNotDefined", wms_exception_format); } @@ -4859,7 +4860,8 @@ int msWMSLegendGraphic(mapObj *map, int nVersion, char **names, if (nLayers == 0) { - msSetError(MS_WMSERR, "Invalid layer given in the LAYER parameter.", + msSetError(MS_WMSERR, "Invalid layer given in the LAYER parameter. A layer might be disabled for \ +this request. Check wms/ows_enable_request settings.", "msWMSGetLegendGraphic()"); return msWMSException(map, nVersion, "LayerNotDefined", wms_exception_format); } @@ -5101,7 +5103,8 @@ int msWMSGetStyles(mapObj *map, int nVersion, char **names, /* validate all layers given. If an invalid layer is sent, return an exception. */ if (validlayer == 0) { - msSetError(MS_WMSERR, "Invalid layer(s) given in the LAYERS parameter.", + msSetError(MS_WMSERR, "Invalid layer(s) given in the LAYERS parameter. A layer might be disabled for \ +this request. Check wms/ows_enable_request settings.", "msWMSGetStyles()"); return msWMSException(map, nVersion, "LayerNotDefined", wms_exception_format); }