Opened 20 years ago

Closed 15 years ago

#649 closed defect (fixed)

DescribeCoverage Not Throwing Exception on Illegal Coverage

Reported by: warmerdam Owned by: sdlime
Priority: high Milestone:
Component: WCS Server Version: unspecified
Severity: normal Keywords:
Cc:

Description (last modified by sdlime)

Currently no exception is thrown if a coverage is requested that does not
exist, but I *think* there should be an exception. 

I would add that the exception should be thrown in the case of a coverage
name that is a layername which isn't enabled for WCS support as well as the
case of a coverage name with no analog in the mapfile.

Change History (8)

comment:1 by fwarmerdam, 20 years ago

On a vaguely related point, I discovered that a DescribeCoverage call for
a file that can't be opened (ie. GDALOpen() returns NULL) results in a 
call to msSetError() but this error message is not returned to the user as
an exception. 


comment:2 by fwarmerdam, 20 years ago

Selecting a FORMAT that is not in the wcs_formats list results in the mime
header being returned, but no data being returned.  No exception is generated.
In this case the OUTPUTFORMAT declaration does exist.  An exception should be
produced. 

comment:3 by tomkralidis, 17 years ago

Committed:

  • msWCSDescribeCoverage: throw Exception if Coverage doesn't exist
  • msWCSException: updated as per WCS 1.0 Appendix A.6

Currently, an Exception is thrown if a format is requested which is not supported. I couldn't reproduce Frank's format issue as per above.

Steve: can you verify? I haven't closed this one due to this issue.

in reply to:  3 comment:4 by sdlime, 17 years ago

Description: modified (diff)

Replying to tomkralidis:

Tom, sorry it's not clear what you want me to verify?

comment:5 by tomkralidis, 17 years ago

Steve: the format comment:

"Selecting a FORMAT that is not in the wcs_formats list results in the mime header being returned, but no data being returned. No exception is generated. In this case the OUTPUTFORMAT declaration does exist. An exception should be produced."

Currently, an Exception is thrown if a format is requested which is not supported. I couldn't reproduce Frank's format issue as per above.

comment:6 by tomkralidis, 17 years ago

Frank: does mapwcs.c line 1252 address the issue of formats?

comment:7 by warmerdam, 17 years ago

Tom,

The following code verifies that the format name is recognised by MapServer (relates to a built-in or user defined outputformat) but it does not restrict things to the list of formats specified in the layer metadata (and returned as the supported format list). I personally don't think it is that critical to force that restriction but this is the right area to do it if required.

  /* check and make sure there is a format, and that it's valid (TODO: make sure in the layer metadata) */
  if(!params->format) {
    msSetError( MS_WCSERR,  "Missing required FORMAT parameter.", "msWCSGetCoverage()" );
    return msWCSException(map, params->version, "MissingParameterValue", "format");
  }
  if(msGetOutputFormatIndex(map,params->format) == -1) {
    msSetError( MS_WCSERR,  "Unrecognized value for the FORMAT parameter.", "msWCSGetCoverage()" );
    return msWCSException(map, params->version, "InvalidParameterValue", "format");
  }

comment:8 by tomkralidis, 15 years ago

Resolution: fixed
Status: newclosed

Closing. OUTPUTFORMATs are being pushed to GetCapabilities, and GetCoverage is throwing an exception if an invalid format is passed.

Note: See TracTickets for help on using tickets.