3.3.5.0.1 Sample

LuaCOM

next up previous contents Next: 3.4 Type Conversion Up: 3.3.5 Exception Handling Previous: 3.3.5 Exception Handling   Contents

3.3.5.0.1 Sample

-- to make all LuaCOM errors runtime errors
luacom.config.abort_on_error = true
luacom.config.abort_on_API_error = true
-- to silently ignore all errors
luacom.config.abort_on_error = false
luacom.config.abort_on_API_error = false
-- catching an ignored error
luacom.config.last_error = nil
obj:RunMethod(x,y)
if luacom.config.last_error then
  print("Error!")
  exit(1)
end

All errors are also logged. Notice that some of the logged exceptions are not really errors: they are side-effects of the extensive use of exception handling inside LuaCOM code.



Fabio Mascarenhas de Queiroz 2005-01-07