For example I might have code like:
But maybe 'foo' isn't really the right variable name, it should be 'bar'. when that line of code executes, nothing happens. Program execution stops, but no indication of the error shows up in the console.
I would really love to see an error like "foo is not defined" instead of having to just look through the code an imagine what might be going wrong.
In previous versions of Arbortext, Rhino would indeed show error messages in the Java Console. But recently I noticed that doesn't happen any more. I'm not sure if there's a way to change a setting somewhere to get that behavior back.
In the meantime, you have a few choices for working around the problem:
You can wrap your code in try/catch blocks and report errors via Application.alert() or Application.print().
You can switch to the MS JScript engine, and use the Microsoft Script Debugger to see what's going on. (That assumes that you're not using any Rhino-specific features like Packages.* to access Java objects.)
Or you could go old-school and liberally sprinkle Application.alert() statements throughout your code during debugging to report variable values and other diagnostic info to help pin down the problem.