Why Doesn't SetThrowExceptionOnScriptError(false) Work?
I am using JDK+NetBeans. I downloaded HtmlUnit, and tried all versions between 2.9 and 2.14, and none worked with this function. For example my code (Java): ..... import com.gargoy
Solution 1:
There is a JavaScript exception thrown there. That means there is something in that JS code that HTMLUnit (Rhino) doesn't like. You should firstly understand that not throwing an exception will not fix a bug in the JS code, if any. So if that issue is not allowing you to perform an action, hiding it or showing it, would still not allow you to perform the action.
Having said that, the setThrowExceptionOnScriptError
method determines if you want the getPage
to forward the unavoidable exception detected in the JS code to your application. In other words, if you want to throw the exception then you will most likely need a try-catch-finally block in your application wrapping the getPage
method.
Answer : Fix your JS code.
Post a Comment for "Why Doesn't SetThrowExceptionOnScriptError(false) Work?"