Python and Jython newbie here.
I am passably familiar with how to raise exceptions in normal Python.
However, in the Jython environment I find myself in (WLST
), if I do:
raise Exception("hello")
...then it appears to raise a java.lang.Exception
:
wls:/offline> raise Exception("hello")
Traceback (innermost last):
File "<console>", line 1, in ?
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
java.lang.Exception: java.lang.Exception: hello
wls:/offline>
How can I raise a Python Exception
in this environment? Or, at least: why is it a java.lang.Exception
that is raised here?