Page 1 of 1

traceback in jython shell

Posted: Mon Sep 12, 2011 2:58 pm
by joleenf
How do I format a traceback error when I am creating a module in the user library? I have tried a number of formats, but the traceback prints the same every time. Below is an example of some of the commands

try:
mydata=AreaAdapter(remote_area) #get the adde data
except IndexError:
exc_type, exc_value, exc_traceback = sys.exc_info()
traceback.print_exception(exc_type, exc_value, exc_traceback,
limit=2, file=sys.stdout) #print errors to screen
print "*** print_tb:"
traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
print "*** print_exc:"
traceback.print_exc()
sys.exit(1)

Thanks,
Joleen