Ticket #649 (new defect)

Opened 4 years ago

Last modified 1 year ago

DescribeCoverage Not Throwing Exception on Illegal Coverage

Reported by: warmerdam Assigned to: 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

05/06/04 16:20:37 changed by fwarmerdam

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. 


05/06/04 16:49:07 changed by fwarmerdam

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. 

(follow-up: ↓ 4 ) 04/29/07 05:38:22 changed by tomkralidis

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 ) 05/01/07 20:28:42 changed by sdlime

  • description changed.

Replying to tomkralidis:

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

05/02/07 07:40:32 changed by tomkralidis

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.

08/13/07 09:38:07 changed by tomkralidis

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

08/20/07 14:35:21 changed by warmerdam

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");
  }