Class WebClientUtil.ExceptionListener

  • All Implemented Interfaces:
    com.gargoylesoftware.htmlunit.javascript.JavaScriptErrorListener
    Enclosing class:
    WebClientUtil

    public static class WebClientUtil.ExceptionListener
    extends Object
    implements com.gargoylesoftware.htmlunit.javascript.JavaScriptErrorListener
    JavaScript Exception listener.
    See Also:
    WebClientUtil.addExceptionListener(WebClient)
    • Method Detail

      • getScriptException

        public com.gargoylesoftware.htmlunit.ScriptException getScriptException()
        Get the last ScriptException.
        Returns:
        The last ScriptException, or null if none happened.
      • getExpectedScriptException

        public com.gargoylesoftware.htmlunit.ScriptException getExpectedScriptException()
        Get the last ScriptException.

        Performs a call to assertHasException().

        Returns:
        The last ScriptException.
      • scriptException

        public void scriptException​(com.gargoylesoftware.htmlunit.html.HtmlPage htmlPage,
                                    com.gargoylesoftware.htmlunit.ScriptException scriptException)
        Specified by:
        scriptException in interface com.gargoylesoftware.htmlunit.javascript.JavaScriptErrorListener
      • assertHasException

        public void assertHasException()
        Assert that a ScriptException occurred within the JavaScript executing on the associated WebClient.
      • timeoutError

        public void timeoutError​(com.gargoylesoftware.htmlunit.html.HtmlPage htmlPage,
                                 long allowedTime,
                                 long executionTime)
        Specified by:
        timeoutError in interface com.gargoylesoftware.htmlunit.javascript.JavaScriptErrorListener
      • malformedScriptURL

        public void malformedScriptURL​(com.gargoylesoftware.htmlunit.html.HtmlPage htmlPage,
                                       String url,
                                       MalformedURLException malformedURLException)
        Specified by:
        malformedScriptURL in interface com.gargoylesoftware.htmlunit.javascript.JavaScriptErrorListener
      • loadScriptError

        public void loadScriptError​(com.gargoylesoftware.htmlunit.html.HtmlPage htmlPage,
                                    URL scriptUrl,
                                    Exception exception)
        Specified by:
        loadScriptError in interface com.gargoylesoftware.htmlunit.javascript.JavaScriptErrorListener
      • warn

        public void warn​(String message,
                         String sourceName,
                         int line,
                         String lineSource,
                         int lineOffset)
        Specified by:
        warn in interface com.gargoylesoftware.htmlunit.javascript.JavaScriptErrorListener