java or jython error codes

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

java or jython error codes

Post by joleenf »

Hi,

I think I have asked this before, but just verifying that there is absolutely no way to get an error code from either jython or java when something goes wrong in my script. I have tried checking the error code from a "raise" command. When executed in python, the shell $? is different when an error is raised versus when the code executes normally. However, when the script is run using runMcV -script scriptname.py, the exit status is the same for either case.

I have also tried sys.exit(<error value>) and java's java.lang.System(<error value>) and these error codes are not reflected in the exit status when the script is run through the runMcV -script scriptname.py process.

Thanks,
Joleen
User avatar
Jon
Posts: 192
Joined: Fri Jan 09, 2009 8:44 pm
Location: Madison, WI

Re: java or jython error codes

Post by Jon »

Hi Joleen,

I've written this up as Inquiry 2427. I'm still working on a fix for Windows, but I believe that the first commit should have things working on macOS and Linux.
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: java or jython error codes

Post by joleenf »

:P Thanks, this should help simplify some of my scripts currently running.
Post Reply