Import not Work

Jython’s Exception class does not inherit from Java’s base exception class - so exceptions thrown in Java code (ie, everything written by Inductive Automation) are not caught by Exception clauses. You have to catch both possible exceptions:

import java.lang.Exception

try:
    # something something something
except Exception, e:
    # jython exception
except java.lang.Exception, e:

or

import java.lang.Exception

try:
    # something something something
except (Exception, java.lang.Exception), e:
	#pass
1 Like