Open tbonfort opened 12 years ago
Author: sdlime Date: 2006/09/12 - 14:53
MapServer does stack the errors and MapScript exposes a function called
msGetErrorString to gain access to all of them. For example, in Perl you do
something like:
$map = new mapscript::mapObj('buffer.map') or die
mapscript::msGetErrorString("\n");
Does that solve the problem?
Steve
Author: karl-ms@sc.com Date: 2006/09/12 - 16:14
That doesn't help. In fact, I'm actually doing that. Here's my equivalent:
::mapscripthelpers::dienull {set ::baseMap [::mapscript::mapObj -filename "flights.map"]}
I was getting the report of "Unable to initialize image", actually, when trying to draw the map:
::mapscripthelpers:;dienull {set mapImage [$map draw]}
I used gdb to trace through the draw (msDrawMap) where I saw the first call to msSetError from
msImageCreateSvg which said "Failed to open temporary svg file" and then when returning to the caller,
msDrawMap, msDrawMap has an "if (image == NULL)" piece where, if it is, it calls msSetError again to
say "Unable to initialize image."
So I don't think there was a way or a place to split the calls and check for an error return... Both errors
get generated by one call to msDrawMap.
Author: sdlime Date: 2006/09/21 - 22:14
The reason we went to an error stack was to avoid having to know what errors or
warnings might be being set further down in the code. Moving away from that
would be a lot of work (i.e. it won't happen).
What scripting language are you using? I don't see how the code you've supplied
is equivalent to calling msGetErrorString unless you're doing it elsewhere on
failure.
Steve
Author: szekerest Date: 2006/09/25 - 18:08
I've tested msGetErrorString and it concatenates the multiple messages to one
message string using the given separator. In the earlier versions there was an
issue that it has truncated the message but this behaviour was fixed long time ago.
Tamas Szekeres
Author: hobu Date: 2007/08/17 - 08:46 Closing. Re-open if this is still a problem. RFC 18 also addresses a number of related msSetError issues...
Reporter: karl-ms@sc.com Date: 2006/09/12 - 14:41