Jump to content

Error debugging DISABLED during missionCommand callback? Why on earth?


Recommended Posts

I've just returned from a debugging trip from hell that almost landed me in the looney bin. Reason: when you set up a callback via missionCommands.addCommand (and their siblings), it seems that when the callback is invoked, Lua suppresses any errors that occur. Should your code do something wrong (e.g. miss a parameter, or dereference nil) it will simply fail silently, without any indication that something has gone wrong. Unless you know what to look for, this can drive you insane (of course I was unlucky enough to insert an error into the debug code that ALSO failed silently - go figure).

 

Does anyone know why this is, and how I can fix that? For debugging purposes I now relay all command callbacks via a scheduled invocation after 0.1 seconds, but that is an ugly cludge that does not scale well

 

Thanks for any pointers.

Link to post
Share on other sites
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...