Failing to catch exceptions from smart card reader

Set up two clauses, like so:

# Important! Do not use "from java.lang import Exception", as that will
# hide access to jython's Exception class.
import java.lang.Exception

def something():
	try:
		# do something
		pass
	except java.lang.Exception, e:
		# Handle java exceptions
		# follow e.cause, e.cause.cause, .... to examine nested exceptions
		pass
	except Exception, e:
		# Handle jython exceptions
		pass
3 Likes