Class DefaultJavaScriptErrorListener

java.lang.Object
org.htmlunit.javascript.DefaultJavaScriptErrorListener
All Implemented Interfaces:
Serializable, JavaScriptErrorListener

public class DefaultJavaScriptErrorListener extends Object implements JavaScriptErrorListener, Serializable
Default implementation of JavaScriptErrorListener that does default logging.
See Also:
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
  • Constructor Details

    • DefaultJavaScriptErrorListener

      public DefaultJavaScriptErrorListener()
  • Method Details

    • scriptException

      public void scriptException(HtmlPage page, ScriptException scriptException)
      Informs about a javascript exceptions.
      Specified by:
      scriptException in interface JavaScriptErrorListener
      Parameters:
      page - the page that causes the problem
      scriptException - the occurred script exception
    • timeoutError

      public void timeoutError(HtmlPage page, long allowedTime, long executionTime)
      Informs about a javascript timeout error.
      Specified by:
      timeoutError in interface JavaScriptErrorListener
      Parameters:
      page - the page that causes the problem
      allowedTime - the max time allowed for the execution
      executionTime - the already consumed time
    • malformedScriptURL

      public void malformedScriptURL(HtmlPage page, String url, MalformedURLException malformedURLException)
      Informs about a malformed url referencing to to script.
      Specified by:
      malformedScriptURL in interface JavaScriptErrorListener
      Parameters:
      page - the page that causes the problem
      url - the malformed url
      malformedURLException - the occurred exception
    • loadScriptError

      public void loadScriptError(HtmlPage page, URL scriptUrl, Exception exception)
      Informs about an exception during load of a javascript file refereed from a page.
      Specified by:
      loadScriptError in interface JavaScriptErrorListener
      Parameters:
      page - the page that causes the problem
      scriptUrl - the url to load the script from
      exception - the occurred exception
    • warn

      public void warn(String message, String sourceName, int line, String lineSource, int lineOffset)
      Informs about a javascript warning.
      Specified by:
      warn in interface JavaScriptErrorListener
      Parameters:
      message - the message to be displayed
      sourceName - the name of the source file
      line - the line number
      lineSource - the source code that failed
      lineOffset - the line offset