Here's an interesting one.

Using the XML parser Xtra and I discovered that when using the callback feature of parseURL, script errors are just ignored. The offending code just exits.

Not getting error messages is A Bad Thing when debugging, as I am sure you will appreciate. I spent enough time hunting this issue that I have decided to post about it.

Bare bones circumstances are demonstrated with this behavior:

property xmlparser

on beginsprite me

  thisURL = "http://www.w3schools.com/xml/note.xml";
  xmlparser = new(xtra "xmlparser")
  xmlparser.parseURL(thisURL, #parseDone, me)

end

on parseDone me, l

  err = xmlparser.getError()

  if voidP (err) or err = "" then -- parse successful?

    l = xmlparser.makelist()
    put l[0] -- deliberate error (index out of range)
    alert "This never happens"

  end if

end

If parseDone() calls some other handlers, this error can be even more difficult to track. The worst thing about this is that *any* script errors are ignored, regardless of kind, so this issue may rear its ugly head under many circumstances.


I suppose some of you know this already, but I post it here so that it might be of use sometime, somewhere.

I long for a proper exception handling mechanism in Lingo.

Brennan
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
lingo-l@penworks.com  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to