Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#3302 closed defect (fixed)

Improve error message when query file extension test fails

Reported by: dmorissette Owned by: dmorissette
Priority: normal Milestone: 5.6.4 release
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc: sdlime

Description (last modified by dmorissette)

A user reported on the -users list that he gets the following error when he tries to load a query file in MapScript:

Error in msEvalRegex(): String failed expression test.

The error doesn't help much in figuring the source of the problem. A new msSetError() with a more explicit message should be added in msLoadQuery() when msEvalRegex() fails, something like "Query file extension check failed (extension must be .qy)"

Change History (11)

comment:1 by dmorissette, 14 years ago

Description: modified (diff)

comment:2 by sdlime, 14 years ago

Good point. Just need to add a custom error message at or near L224 in mapquery.c in msLoadQuery(). -Steve

comment:3 by tomkralidis, 14 years ago

Committed in r9829.

comment:4 by aboudreault, 14 years ago

Resolution: fixed
Status: newclosed

comment:5 by dmorissette, 14 years ago

Resolution: fixed
Status: closedreopened

Reopening. You modified the wrong test Tom and <wrist_slap>obviously didn't reproduce the problem and test the fix</wrist_slap>

comment:6 by dmorissette, 14 years ago

Milestone: 5.6.2 release5.6.4 release
Owner: changed from aboudreault to dmorissette
Status: reopenednew

Taking care of this now.

comment:7 by dmorissette, 14 years ago

Resolution: fixed
Status: newclosed

Fixed in SVN branch-5-6 r10023 and trunk r10024.

comment:8 by jmckenna, 14 years ago

Daniel, do you know if this query extension requirement is documented somewhere? I'm just making sure...

comment:9 by dmorissette, 14 years ago

Good catch Jeff. A note should probably be added to the saveQuery() method docs in http://mapserver.org/mapscript/php/index.html (PHP) and http://mapserver.org/mapscript/mapscript.html (SWIG).

With respect to the CGI, I believe the temporary queryfile's filename+ext are generated automatically by the SAVEQUERY option, and returned via the [queryfile] template tag so there is no need to add a note there. I will let Steve confirm.

comment:10 by sdlime, 14 years ago

The CGI behavior Dan describes is correct... Steve

Note: See TracTickets for help on using tickets.