[Mapserver-dev] Comments on error stack and MS_NOTFOUND

Sean Gillies sgillies at frii.com
Wed Aug 4 11:45:10 EDT 2004


Yesterday I set out to fix bug 361, and during this work took
a look at the way we are using the mapserver error stack.

Mostly, we are using msSetError like we'd raise a C++ exception,
and doing it correctly.  Exceptions should not be thrown during
normal operations and shouldn't be used for flow control.  The
only mapserver error which violates this principle is MS_NOTFOUND.
There is code in mapserv.c and one place in each of mapwms.c and
mapwfs.c that count upon this error being thrown during a normal
operation (zero query results).

Although I couldn't resolve the bug in the ideal way, I am *very*
happy that we continue to use mapserver's errors in a (mostly)
consistent and correct manner.  The Python mapscript module (and,
eventually Java and Ruby modules) count on msSetError being used
like a C++ exception.

cheers,
Sean




More information about the mapserver-dev mailing list