I could be wrong, but it seems I'm only getting incomplete stack traces and exception messages when a SystemError is raised in IronPython. I'm doing this:
with SQLConnection(DATASOURCES[SCHEDULEDB]) as db:
db.execute_sql( command + ' ' + ','.join(block) + ';' )
except Exception, e:
print 'caught an exception'
print "Unexpected error:", sys.exc_info()
Traceback (most recent call last):
SystemError: The connection has been disabled.
import traceback traceback.print_exc()
Instead of printing the exception object directly. In Python exception objects don't hold onto the stack trace directly - instead they're part of the trio of items in sys.exc_info().
You could also do:
import System ... except System.Exception, e:
and you'll get a normal .NET exception object instead of the Python exception object.