Package org.htmlunit

Class WebClientUtil.ExceptionListener

java.lang.Object
org.htmlunit.WebClientUtil.ExceptionListener
All Implemented Interfaces:
org.htmlunit.javascript.JavaScriptErrorListener
Enclosing class:
WebClientUtil

public static class WebClientUtil.ExceptionListener extends Object implements org.htmlunit.javascript.JavaScriptErrorListener
JavaScript Exception listener.
See Also:
  • Method Details

    • getScriptException

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

      public org.htmlunit.ScriptException getExpectedScriptException()
      Get the last ScriptException.

      Performs a call to assertHasException().

      Returns:
      The last ScriptException.
    • scriptException

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

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

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

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

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

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