Permalink
Browse files

Correcting and harmonizing exceptionCode and locator usage in WCS (#4388

).
  • Loading branch information...
1 parent 3cb915d commit c37b3bc66091b84bdfd9259fc8e11d79b91882b3 @Schpidi Schpidi committed Feb 12, 2015
Showing with 28 additions and 28 deletions.
  1. +15 −15 mapwcs11.c
  2. +13 −13 mapwcs20.c
View
@@ -57,8 +57,8 @@
**
*/
-int msWCSException11(mapObj *map, const char *locator,
- const char *exceptionCode, const char *version)
+int msWCSException11(mapObj *map, const char *exceptionCode,
+ const char *locator, const char *version)
{
int size = 0;
char *errorString = NULL;
@@ -399,11 +399,11 @@ int msWCSGetCapabilities11(mapObj *map, wcsParamsObj *params,
i = msOWSNegotiateUpdateSequence(params->updatesequence, updatesequence);
if (i == 0) { /* current */
msSetError(MS_WCSERR, "UPDATESEQUENCE parameter (%s) is equal to server (%s)", "msWCSGetCapabilities11()", params->updatesequence, updatesequence);
- return msWCSException11(map, "updatesequence", "CurrentUpdateSequence", params->version);
+ return msWCSException11(map, "CurrentUpdateSequence", "updatesequence", params->version);
}
if (i > 0) { /* invalid */
msSetError(MS_WCSERR, "UPDATESEQUENCE parameter (%s) is higher than server (%s)", "msWCSGetCapabilities11()", params->updatesequence, updatesequence);
- return msWCSException11(map, "updatesequence", "InvalidUpdateSequence", params->version);
+ return msWCSException11(map, "InvalidUpdateSequence", "updatesequence", params->version);
}
}
@@ -490,7 +490,7 @@ int msWCSGetCapabilities11(mapObj *map, wcsParamsObj *params,
if ((script_url=msOWSGetOnlineResource(map, "CO", "onlineresource", req)) == NULL
|| (script_url_encoded = msEncodeHTMLEntities(script_url)) == NULL) {
msSetError(MS_WCSERR, "Server URL not found", "msWCSGetCapabilities11()");
- return msWCSException11(map, "mapserv", "NoApplicableCode", params->version);
+ return msWCSException11(map, "NoApplicableCode", "mapserv", params->version);
}
free( script_url );
@@ -931,7 +931,7 @@ int msWCSDescribeCoverage11(mapObj *map, wcsParamsObj *params, owsRequestObj *ow
msSetError( MS_WCSERR,
"COVERAGE %s cannot be opened / does not exist",
"msWCSDescribeCoverage()", params->coverages[j]);
- return msWCSException11(map, "coverage", "CoverageNotDefined", params->version);
+ return msWCSException11(map, "CoverageNotDefined", "coverage", params->version);
}
}
}
@@ -1095,7 +1095,7 @@ int msWCSGetCoverageBands11( mapObj *map, cgiRequestObj *request,
field_id, rangesubset );
free(rangesubset);
free(field_id);
- return msWCSException11(map, "mapserv", "NoApplicableCode", params->version);
+ return msWCSException11(map, "NoApplicableCode", "mapserv", params->version);
}
free( field_id );
@@ -1135,7 +1135,7 @@ int msWCSGetCoverageBands11( mapObj *map, cgiRequestObj *request,
"msWCSGetCoverageBands11()",
axis_id, rangesubset );
free(rangesubset);
- return msWCSException11(map, "mapserv", "NoApplicableCode", params->version);
+ return msWCSException11(map, "NoApplicableCode", "mapserv", params->version);
}
/* -------------------------------------------------------------------- */
@@ -1194,7 +1194,7 @@ int msWCSReturnCoverage11( wcsParamsObj *params, mapObj *map,
"Failed to find %s driver.",
"msWCSReturnCoverage11()",
image->format->driver+5 );
- return msWCSException11(map, "mapserv", "NoApplicableCode",
+ return msWCSException11(map, "NoApplicableCode", "mapserv",
params->version);
}
@@ -1219,7 +1219,7 @@ int msWCSReturnCoverage11( wcsParamsObj *params, mapObj *map,
msFree(filename);
msSetError(MS_MISCERR, "msSaveImage() failed",
"msWCSReturnCoverage11()");
- return msWCSException11(map, "mapserv", "NoApplicableCode",
+ return msWCSException11(map, "NoApplicableCode", "mapserv",
params->version);
}
}
@@ -1287,7 +1287,7 @@ int msWCSReturnCoverage11( wcsParamsObj *params, mapObj *map,
status = msSaveImage(map, image, NULL);
if( status != MS_SUCCESS ) {
msSetError( MS_MISCERR, "msSaveImage() failed", "msWCSReturnCoverage11()");
- return msWCSException11(map, "mapserv", "NoApplicableCode", params->version);
+ return msWCSException11(map, "NoApplicableCode", "mapserv", params->version);
}
msIO_fprintf( stdout, "\r\n--wcs--\r\n" );
@@ -1406,7 +1406,7 @@ int msWCSDescribeCoverage11(mapObj *map, wcsParamsObj *params,
msSetError( MS_WCSERR,
"WCS 1.1 request made, but mapserver requires libxml2 for WCS 1.1 services and this is not configured.",
"msWCSDescribeCoverage11()", "NoApplicableCode" );
- return msWCSException11(map, "mapserv", "NoApplicableCode", params->version);
+ return msWCSException11(map, "NoApplicableCode", "mapserv", params->version);
}
/* ==================================================================== */
@@ -1418,13 +1418,13 @@ int msWCSGetCapabilities11(mapObj *map, wcsParamsObj *params,
"WCS 1.1 request made, but mapserver requires libxml2 for WCS 1.1 services and this is not configured.",
"msWCSGetCapabilities11()", "NoApplicableCode" );
- return msWCSException11(map, "mapserv", "NoApplicableCode", params->version);
+ return msWCSException11(map, "NoApplicableCode", "mapserv", params->version);
}
-int msWCSException11(mapObj *map, const char *locator, const char *exceptionCode, const char *version)
+int msWCSException11(mapObj *map, const char *exceptionCode, const char *locator, const char *version)
{
/* fallback to reporting using 1.0 style exceptions. */
- return msWCSException( map, locator, exceptionCode, "1.0.0" );
+ return msWCSException( map, exceptionCode, locator, "1.0.0" );
}
#endif /* defined(USE_WCS_SVR) && !defined(USE_LIBXML2) */
View
@@ -1109,7 +1109,7 @@ static int msWCSValidateAndFindAxes20(
static const int numAxis = 2;
char *validXAxisNames[] = {"x", "xaxis", "x-axis", "x_axis", "long", "long_axis", "long-axis", "lon", "lon_axis", "lon-axis", NULL};
char *validYAxisNames[] = {"y", "yaxis", "y-axis", "y_axis", "lat", "lat_axis", "lat-axis", NULL};
- char **validAxisNames[2];
+ char **validAxisNames[2];
int iParamAxis, iAcceptedAxis, iName, i;
validAxisNames[0] = validXAxisNames;
@@ -1642,7 +1642,7 @@ static int msWCSWriteFile20(mapObj* map, imageObj* image, wcs20ParamsObjPtr para
"Failed to find %s driver.",
"msWCSWriteFile20()",
image->format->driver+5 );
- return msWCSException(map, "mapserv", "NoApplicableCode",
+ return msWCSException(map, "NoApplicableCode", "mapserv",
params->version);
}
@@ -1666,7 +1666,7 @@ static int msWCSWriteFile20(mapObj* map, imageObj* image, wcs20ParamsObjPtr para
if( status != MS_SUCCESS ) {
msSetError(MS_MISCERR, "msSaveImage() failed",
"msWCSWriteFile20()");
- return msWCSException20(map, "mapserv", "NoApplicableCode",
+ return msWCSException20(map, "NoApplicableCode", "mapserv",
params->version);
}
}
@@ -1716,7 +1716,7 @@ static int msWCSWriteFile20(mapObj* map, imageObj* image, wcs20ParamsObjPtr para
status = msSaveImage(map, image, NULL);
if( status != MS_SUCCESS ) {
msSetError( MS_MISCERR, "msSaveImage() failed", "msWCSWriteFile20()");
- return msWCSException(map, "mapserv", "NoApplicableCode", params->version);
+ return msWCSException(map, "NoApplicableCode", "mapserv", params->version);
}
if(multipart)
msIO_fprintf( stdout, "\r\n--wcs--\r\n" );
@@ -2623,15 +2623,15 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
msSetError(MS_WCSERR, "UPDATESEQUENCE parameter (%s) is equal to server (%s)",
"msWCSGetCapabilities20()", params->updatesequence, updatesequence);
xmlFreeDoc(psDoc);
- return msWCSException(map, "updatesequence",
- "CurrentUpdateSequence", params->version);
+ return msWCSException(map, "CurrentUpdateSequence", "updatesequence",
+ params->version);
}
if (i > 0) { /* invalid */
msSetError(MS_WCSERR, "UPDATESEQUENCE parameter (%s) is higher than server (%s)",
"msWCSGetCapabilities20()", params->updatesequence, updatesequence);
xmlFreeDoc(psDoc);
- return msWCSException(map, "updatesequence",
- "InvalidUpdateSequence", params->version);
+ return msWCSException(map, "InvalidUpdateSequence", "updatesequence",
+ params->version);
}
}
if(updatesequence != NULL) {
@@ -2661,7 +2661,7 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
|| (script_url_encoded = msEncodeHTMLEntities(script_url)) == NULL) {
xmlFreeDoc(psDoc);
msSetError(MS_WCSERR, "Server URL not found", "msWCSGetCapabilities20()");
- return msWCSException(map, "mapserv", "NoApplicableCode", params->version);
+ return msWCSException(map, "NoApplicableCode", "mapserv", params->version);
}
free(script_url);
@@ -2717,7 +2717,7 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
/* Apply default formats */
msApplyDefaultOutputFormats(map);
-
+
/* Add formats list */
format_list = msWCSGetFormatsList20(map, NULL);
msLibXml2GenerateList(psNode, psWcsNs, "formatSupported", format_list, ',');
@@ -2750,7 +2750,7 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
if(status != MS_SUCCESS) {
xmlFreeDoc(psDoc);
xmlCleanupParser();
- return msWCSException(map, "mapserv", "Internal", params->version);
+ return msWCSException(map, "Internal", "mapserv", params->version);
}
}
}
@@ -2986,7 +2986,7 @@ int msWCSDescribeCoverage20(mapObj *map, wcs20ParamsObjPtr params, owsRequestObj
static int msWCSGetCoverage20_FinalizeParamsObj(wcs20ParamsObjPtr params, wcs20AxisObjPtr *axes)
{
char *crs = NULL;
-
+
if (axes[0] != NULL) {
if(axes[0]->subset != NULL) {
msDebug("Subset for X-axis found: %s\n", axes[0]->subset->axis);
@@ -3604,7 +3604,7 @@ this request. Check wcs/ows_enable_request settings.", "msWCSGetCoverage20()", p
/* set the imagetype from the original outputformat back (it was removed by msSelectOutputFormat() */
msFree(map->imagetype);
map->imagetype = origImageType;
-
+
}
}

0 comments on commit c37b3bc

Please sign in to comment.