Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
I have Javascript code embedded in a XUI dialog and I would like to see errors when something goes wrong. I think that the errors should go to the java console, but nothing ever shows up. Do I need to do something to get the errors to appear?
For example I might have code like:
do_something(foo);
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.
Hi Mike--
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:
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.
--Clay
Clay,
Thanks for the answer. We can't switch to JScript because we are calling Java code from the JavaScript. I'll give the try/catch a go, that will be better than just bisecting the code with alerts until you find the error.
-Mike