I get an exception infrequently when performing a write to a database table from a script called by a Gateway timer.
I have the write wrapped by try…except, and I write to a backup table if the first fails. In order to find the cause for the exception I need access to the GatewayException and\or SQLServerException from the traceback object. All I can seem to get is the Exception, which just tells me there was an error executing that query, not the cause.
I am testing using the following code that is ran by a button press. ProductionDemanded does not exist.
a = system.db.runQuery("SELECT * FROM ProductionDemanded")
system.gui.messageBox("%s" % traceback.format_exc())
How can I do this?