Menu

#19 Catching Errors

open
nobody
None
5
2013-04-01
2013-04-01
No

In the set_event_handler() procedure, maybe we could do something like this:

if this > 0 then
c_proc( WX_SET_EVENT_HANDLER, {this, id[i], event[e], rid})
else
crash("Attempt to set handler for undefined object")
end if

That way, we get at least a reasonably helpful error message instead of a machine exception error.

For some reason, the variable I'm passing to set_event_handler() is 0. I don't know why right now. It's happening with the XRC functionality. I'll keep looking, but this is still a better way to handle a '0' for the this variable... right?

Discussion


Log in to post a comment.