I have come up with the following approach for 'catch all' error handling of unexpected errors using this as reference:
import sys
import traceback
logger = system.util.getLogger("ScriptDebugging")
# Some identifier for script name. 'calcQnty' is a custom method on a button component
scriptName = self.name + ".calcQnty"
try:
# Some code
except:
exType, ex, tb = sys.exc_info()
logger.error("ERROR in '%s' line %d: %s, %s" % (scriptName,traceback.tb_lineno(tb), exType, ex))
Provides the following output which i think provides all the info I would need to debug:
13:47:12.268 [Thread-39] ERROR ScriptDebugging - ERROR in 'Button Calc Volume.calcQnty' line 61: <type 'exceptions.TypeError'>, getValueAt(): 1st arg can't be coerced to int