[mapserver-users] A suggestion to improve error messages:

David McKelvie dmck at interactive.co.uk
Tue Jul 16 07:37:15 PDT 2019


A suggestion to improve error messages:

Trying to get a maptile I got the error page

msCGILoadMap(): Web application error. Parameter 'map' value fails to validate.

It would be really helpful if this could have said

msCGILoadMap(): Web application error. Parameter 'map' value
'/var/opt/mapserver/mymap.map' fails to match the MS_MAP_PATTERN value
'/home/data'.

Or something similar, with more details about what went wrong.

This should not be a large and complicated change to
mapserver-7.2.2/mapservutil.c
to update the error message.

./mapserver-7.2.2/mapservutil.c:

if(getenv("MS_MAP_PATTERN") && msEvalRegex(getenv("MS_MAP_PATTERN"), mapserv->request->ParamValues[i]) != MS_TRUE) {
   msSetError(MS_WEBERR, "Parameter 'map' value fails to validate.", "msCGILoadMap()");
   return NULL;
}

David McKelvie



More information about the MapServer-users mailing list