I need a sanity check.
If I have a set of functions that I want to run from a tag change event, regardless of whether there is an exception in each preceding block, is this syntax what I’m needing? Or am I missing something more elegant?
from java.lang import Throwable
import traceback
logger = system.util.getLogger('myExceptionLogger')
try:
runCodeA()
except Throwable, t:
logger.warn("CodeA failed with a Java exception: ", t)
except Exception, e:
logger.warn("CodeA failed with a Jython exception: ", e)
try:
runCodeB()
except Throwable, t:
logger.warn("CodeB failed with a Java exception: ", t)
except Exception, e:
logger.warn("CodeB failed with a Jython exception: ", e)
try:
runCodeC()
except Throwable, t:
logger.warn("CodeC failed with a Java exception: ", t)
except Exception, e:
logger.warn("CodeC failed with a Jython exception: ", e)