[Mapserver-dev] Error stack system

Steve Lime steve.lime at dnr.state.mn.us
Fri Jan 17 00:10:50 EST 2003


Suprised you didn't get more (any?) comments on this. Especially given
the home grown nature of the error handline. A simple stack (still using
the global error variable) shouldn't have to much impact. I don't think
we're allowing direct access to that variable anyway so this  type of a
modification would have little (any?) impact on existing code. Probably
just want a function or two to dump the stack, instead of the most
recent message.

Fine by me, at least for closer look...

Steve

>>> Daniel Morissette <morissette at dmsolutions.ca> 01/09/03 14:00 PM >>>
Hi,

I would like to start discussing a potential improvement to error
reporting in MapServer.

In the current implementation, if multiple functions call msSetError()
at multiple levels in the call stack, it is only the message from the
last msSetError() call that is reported.  This results in situations
like "msDrawMap() failed" but you don't know why because the lower-level
error has been overwritten by the more generic message.

Of course one can use logfiles to debug the problem, but I'm looking for
a way to allow MapScript applications to do better error handling.  The
specific case that I have to deal with now is drawing a map that
contains WMS/WFS layers.

Imagine a map with 10 layers, 5 shapefile layers and 5 WMS layers.  When
we do a call to $map->draw(), one of the WMS layers may timeout, or
another one might point to a server that is not available any more (404
error) and I would like to provide a mean to trap this in MapScript and
report the problems to the user while still showing a map with the
layers that did work.

One of the ways to achieve this could be to set a kind of error_status
flag (or error_code and error_message metadata???) in every layer in the
map, and after the call to $map->draw() we could loop through the
layers, check their error_status and take action.

The other option would be to modify the error handling in MapServer to
accumulate the error messages in a stack when msSetError() is called
multiple times and provice a function via MapScript to loop through the
error stack.  The main benefit of this is not for WMS, but for the more
general case: when reporting errors, MapServer would report all errors
in the stack and not just the last error.

I am looking for comments on what other developers think is best.  I
think the layer-based error_code/error_message metadata would be better
to solve the current WMS/WFS $map->draw() problems, but OTOH an error
stack system would benefit to the rest of MapServer.

Comments, thoughts?

Daniel 
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
_______________________________________________
Mapserver-dev mailing list
Mapserver-dev at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-dev




More information about the mapserver-dev mailing list