Permalink
Browse files

Adjust exceptionCode in WCS 2.0 (#4735).

  • Loading branch information...
1 parent d3ec344 commit 36e2f744cd4c0283c95d1382090ed1a30a6dae6e @Schpidi Schpidi committed Aug 18, 2013
Showing with 16 additions and 14 deletions.
  1. +16 −14 mapwcs20.c
View
@@ -1120,20 +1120,6 @@ static int msWCSValidateAndFindAxes20(
for(iParamAxis = 0; iParamAxis < params->numaxes; ++iParamAxis) {
int found = 0;
- /* check if subset is valid */
- if(params->axes[iParamAxis]->subset != NULL) {
- if(params->axes[iParamAxis]->subset->timeOrScalar == MS_WCS20_TIME_VALUE) {
- msSetError(MS_WCSERR, "Time values for subsets are not supported. ",
- "msWCSValidateAndFindAxes20()");
- return MS_FAILURE;
- }
- if(params->axes[iParamAxis]->subset->operation == MS_WCS20_SLICE) {
- msSetError(MS_WCSERR, "Subset operation 'slice' is not supported.",
- "msWCSValidateAndFindAxes20()");
- return MS_FAILURE;
- }
- }
-
/* iterate over all given axes */
for(iAcceptedAxis = 0; iAcceptedAxis < numAxis; ++iAcceptedAxis ) {
/* iterate over all possible names for the current axis */
@@ -3213,6 +3199,22 @@ this request. Check wcs/ows_enable_request settings.", "msWCSGetCoverage20()", p
"projection", params->version);
}
+ /* iterate over all subsets and check if they are valid*/
+ for(i = 0; i < params->numaxes; ++i) {
+ if(params->axes[i]->subset != NULL) {
+ if(params->axes[i]->subset->timeOrScalar == MS_WCS20_TIME_VALUE) {
+ msSetError(MS_WCSERR, "Time values for subsets are not supported. ",
+ "msWCSGetCoverage20()");
+ return msWCSException(map, "InvalidSubsetting", "subset", params->version);
+ }
+ if(params->axes[i]->subset->operation == MS_WCS20_SLICE) {
+ msSetError(MS_WCSERR, "Subset operation 'slice' is not supported.",
+ "msWCSGetCoverage20()");
+ return msWCSException(map, "InvalidSubsetting", "subset", params->version);
+ }
+ }
+ }
+
{
wcs20AxisObjPtr *axes;
axes = msSmallMalloc(sizeof(wcs20AxisObjPtr) * 2);

0 comments on commit 36e2f74

Please sign in to comment.