Class WebErrorEvent

All Implemented Interfaces:
Serializable, Cloneable

public final class WebErrorEvent extends Event
An event indicating a WebEngine error. Holds an optional text message and an optional exception associated with the error.
Since:
JavaFX 8.0
See Also:
  • Field Details

    • ANY

      public static final EventType<WebErrorEvent> ANY
      Common supertype for all WebErrorEvent types.
    • USER_DATA_DIRECTORY_ALREADY_IN_USE

      public static final EventType<WebErrorEvent> USER_DATA_DIRECTORY_ALREADY_IN_USE
      This event occurs when a WebEngine detects that its user data directory is already in use by a WebEngine running in a different VM.

      In general, multiple WebEngine instances may share a single user data directory as long as they run in the same VM. WebEngine instances running in different VMs are not allowed to share the same user data directory.

      When a WebEngine is about to start loading a web page or executing a script for the first time, it checks whether its

      invalid @link
      userDataDirectory
      is already in use by a WebEngine running in a different VM. If the latter is the case, the WebEngine invokes the WebEngine.onError event handler, if any, with a USER_DATA_DIRECTORY_ALREADY_IN_USE event. If the invoked event handler modifies the userDataDirectory property, the WebEngine retries with the new user data directory as soon as the handler returns. If the handler does not modify the userDataDirectory property (which is the default), the WebEngine continues without the user data directory.
    • USER_DATA_DIRECTORY_IO_ERROR

      public static final EventType<WebErrorEvent> USER_DATA_DIRECTORY_IO_ERROR
      This event occurs when a WebEngine encounters an I/O error while trying to create or access the user data directory.

      When a WebEngine is about to start loading a web page or executing a script for the first time, it checks whether it can create or access its

      invalid @link
      userDataDirectory
      . If the check fails with an I/O error (such as java.io.IOException), the WebEngine invokes the WebEngine.onError event handler, if any, with a USER_DATA_DIRECTORY_IO_ERROR event. If the invoked event handler modifies the userDataDirectory property, the WebEngine retries with the new user data directory as soon as the handler returns. If the handler does not modify the userDataDirectory property (which is the default), the WebEngine continues without the user data directory.
    • USER_DATA_DIRECTORY_SECURITY_ERROR

      public static final EventType<WebErrorEvent> USER_DATA_DIRECTORY_SECURITY_ERROR
      This event occurs when a WebEngine encounters a security error while trying to create or access the user data directory.

      When a WebEngine is about to start loading a web page or executing a script for the first time, it checks whether it can create or access its

      invalid @link
      userDataDirectory
      . If the check fails with a security error (such as java.lang.SecurityException), the WebEngine invokes the WebEngine.onError event handler, if any, with a USER_DATA_DIRECTORY_SECURITY_ERROR event. If the invoked event handler modifies the userDataDirectory property, the WebEngine retries with the new user data directory as soon as the handler returns. If the handler does not modify the userDataDirectory property (which is the default), the WebEngine continues without the user data directory.
  • Constructor Details

    • WebErrorEvent

      public WebErrorEvent(Object source, EventType<WebErrorEvent> type, String message, Throwable exception)
      Creates a new WebErrorEvent.
      Parameters:
      source - the event source which sent the event
      type - the event type
      message - the text message associated with the event; may be null
      exception - the exception associated with the event; may be null
  • Method Details

    • getMessage

      public String getMessage()
      Returns the text message associated with this event.
      Returns:
      the text message associated with this event, or null if there is no such message
    • getException

      public Throwable getException()
      Returns the exception associated with this event.
      Returns:
      the exception associated with this event, or null if there is no such exception