Summary: | [Chameleon - Core] Improve mapserver error reporting | ||
---|---|---|---|
Product: | Chameleon | Reporter: | Paul Spencer <pspencer@dmsolutions.ca> |
Component: | Core | Assignee: | chameleon-dev <chameleon-dev@lists.maptools.org> |
Status: | CLOSED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 1.99 | ||
Target Milestone: | 1.99 beta 3 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
done in cvs, changes applied to drawmap.php (php_utils/src/wrapper/) and to chameleon.php.
The bug is difficult to verify, setting to verified unless norm you have some ideas. This is more of an enhancement request than a bug.
We need to generate an error that will output this kind of message. Paul could u give us an example?
um, tricky because you actually have to set it up such that mapserver generates an error in drawing the map, this came about because of invalid qix files, perhaps Daniel could suggest a way to cause a shapefile to have an invalid qix file? The previous way of displaying this caused the error report widget to display empty error messages, the new way will cause it to at least list a human readable form of the error code, in the case of the qix error I think it should now say MapServer Memory Allocation Error ... which is still not descriptive of the real problem, but that is a mapserver problem, not a chameleon problem since we are just reporting what MapServer tells us.
This bug can be closed, by filing a bug on Mapserver-Bugzilla. What do you think Norm?
Chris I don't think so because we want to verify what Chameleon is going to do when this kind of message pops up. That is why we need some way of generating a MS error. But we should open a MS bug for message unclear.
The initial problem was not a MapServer bug, it's the way it works: MapServer errors are composed of a code and an optional message. The error codes map to a set of generic messages defined in maperror.c. What client code such as chameleon needs to do is display the generic message corresponding to the error code, optionally followed by the more descriptive message if present. Now that I think about it, it is not be possible to fetch the generic error message for a given error code. This should probbaly be added as a method of the errorObj. How did you fix this bug in Chameleon Paul?
Norm what should be do with this bug? should we close it?
No Chris, I thing we should wait for Paul's answer.
yes I was able to draw rectangles, but they would disappear once I completed the draw. Is this the case on Linux, or does the polygon you drew post session expiring stays on the map? If yes to the polygon not being saved on the map. Then I think this is ok, for this bug since the issue was that when the session expired you got a broken image map when trying to use the ROI tool. Where the solution was to have the "session expired" label at the top left of the map explains clearly to the user what has happened. If you think the user should not even be able to draw a rectangle post draw than maybe this should be a new bug to be discussed and/or fixed for beta 3.??
sorry ignore last comment, wrong bug.
Daniel, I took the list from one of the ms header files, the codes are converted to text strings based on error numbers using a big if or switch. Ideally there would be a mapserver function to get the human readable version of an error number. Then I would remove all this code from Chameleon and replace it with a call to mapscript :>
Darren, I found an old beta 2 bug that needs to be set to closed for beta 3. Paul, what is the best way to verify this bug? or rather how was this verified?
the original problem was mapserver reporting a memory allocation error, which didn't have an associated description so nothing got printed in the error widget's popup box. I would imagine that you could create a .qix file (empty text file) associated with one of your shape files and mapserver would choke on it, producing this error (which it is supposed to) and then you would see an appropriate error message in the error widget (instead of no error message). Note that I don't know why the error happens (.qix is just one cause of it) so you won't get much help from the error message, but there will be some text instead of a dot with nothing next to it.
I was unable to get a chameleon error in the errorreport widget, because I recieved a php.exe error onload from creating a blank /samples/data/roads.qix file. http://localhost/chameleon/samples/sample_enhanced.phtml If I placed text in the qix file, there is no error generated and the roads layer does not show up.
I made the same test on Linux without success. I also built a ".qix" file with "shptree". I then corrupted it. Same thing no error came out.
I don't think this deserves to be reopened because you cannot generate an error to reproduce it. The problem is fixed and was verified with the IOOS application (before Dean deleted the invalid qix files). In normal processing, this error should never come up anyway, so it seems pointless to keep it open. I'm closing this bug although if you are desperate to try to reproduce the original conditions, perhaps you could try an older version of mapserver .
I am content with your comment paul. :) setting to verified. Norm?
Satisfied with Paul's comment.