Opened 15 years ago

Last modified 15 years ago

#3040 assigned defect

WFS GetFeature Error Reporting

Reported by: jimk Owned by: tomkralidis
Priority: normal Milestone:
Component: WFS Server Version: svn-trunk (development)
Severity: normal Keywords:
Cc: assefa

Description

Currently, the result code of msGMLWriteWFSQuery is ignored in msWFSGetFeature (line mapwfs.c:1656 in trunk r9069). This means any errors from msGMLWriteWFSQuery (and above such as in the driver level) are ignored.

Attached is a patch to raise a WFS Exception if msGMLWriteWFSQuery returns other than MS_SUCCESS.

Attachments (1)

wfs-error-reporting.patch (734 bytes ) - added by jimk 15 years ago.

Download all attachments as: .zip

Change History (11)

by jimk, 15 years ago

Attachment: wfs-error-reporting.patch added

comment:1 by tomkralidis, 15 years ago

Owner: changed from mapserverbugs to tomkralidis
Status: newassigned

comment:2 by tomkralidis, 15 years ago

Jim: thanks for this. I've applied the patch locally (added some support for WFS 1.1 exceptions). What's an way to test this?

in reply to:  2 comment:3 by jimk, 15 years ago

Replying to tomkralidis:

Jim: thanks for this. I've applied the patch locally (added some support for WFS 1.1 exceptions). What's an way to test this?

I found it while debugging a misbehaving Oracle Spatial layer. It was failing, but with no error messages. I suppose the easiest way to test would be to rig msLayerGetShape to fail inside msGMLWriteWFSQuery.

comment:4 by tomkralidis, 15 years ago

Cc: assefa added

Thanks for the info. I reproduced this when trying against a !PostGIS layer (had database shut down). The problem is that msIO_printf is already printing out the response before the exception occurs. We need a way to trap this before printing out a successful response.

comment:5 by assefa, 15 years ago

I think it would be difficult to trap the errors that would happen in msLayerResultsGetShape in the way things are setup now re the gml output.

Maybe in stead of sending a full exception, we could maybe get the error string and add it as a comment in the xml (same way as we do the the warnings <!-- WARNING: ....)

comment:6 by jimk, 15 years ago

My main objective was to stop having it return success (from the function and in the GML output) when it clearly was failing. (In my case partway through the layer, so there was some data output, but the results were "mysteriously" truncated.) I am weary of a warning comment because clients don't pick up on those and so end users will not be alerted that something failed and will likely believe they received complete/correct results.

The WFS exception block causes the client to report an error which alerts the user and the user can then alert the server admin.

comment:7 by tomkralidis, 15 years ago

Assefa: doesn't the actual GetFeature query in mapwfs.c happen at line 1554? Is there any way we can catch a failure there?

comment:8 by assefa, 15 years ago

The query happens at that point and if an error It is trapped. From my understanding, this bug case is that the query was successful and something happens in the middle of writing the gml output. Isn't that the case? I am not sure I have a better suggestion that what I mentioned in earlier comment about the warning.

comment:9 by tomkralidis, 15 years ago

Assefa: thanks for the info. I think this is the case. My question at this point would be why would msGMLWriteWFSQuery fail, when the underlying query is successful?

comment:10 by assefa, 15 years ago

I guess the cases presented in this bug suggest that something happened to the underlying data (DB) between the query and the writing of the results. I can not reproduce it myself.

Note: See TracTickets for help on using tickets.