Class WebErrorEvent
- All Implemented Interfaces:
Serializable
,Cloneable
WebEngine
error.
Holds an optional text message and an optional exception
associated with the error.- Since:
- JavaFX 8.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final EventType<WebErrorEvent>
Common supertype for allWebErrorEvent
types.static final EventType<WebErrorEvent>
This event occurs when aWebEngine
detects that its user data directory is already in use by aWebEngine
running in a different VM.static final EventType<WebErrorEvent>
This event occurs when aWebEngine
encounters an I/O error while trying to create or access the user data directory.static final EventType<WebErrorEvent>
This event occurs when aWebEngine
encounters a security error while trying to create or access the user data directory.Fields inherited from class javafx.event.Event
consumed, eventType, NULL_SOURCE_TARGET, target
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionWebErrorEvent
(Object source, EventType<WebErrorEvent> type, String message, Throwable exception) Creates a newWebErrorEvent
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the exception associated with this event.Returns the text message associated with this event.Methods inherited from class javafx.event.Event
consume, copyFor, duplicate, fireEvent, getEventType, getPropagateToPeerEvent, getTarget, isConsumed, setPropagateToPeerEvent
Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
ANY
Common supertype for allWebErrorEvent
types. -
USER_DATA_DIRECTORY_ALREADY_IN_USE
This event occurs when aWebEngine
detects that its user data directory is already in use by aWebEngine
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 itsinvalid @link
userDataDirectory
WebEngine
running in a different VM. If the latter is the case, theWebEngine
invokes theWebEngine.onError
event handler, if any, with aUSER_DATA_DIRECTORY_ALREADY_IN_USE
event. If the invoked event handler modifies theuserDataDirectory
property, theWebEngine
retries with the new user data directory as soon as the handler returns. If the handler does not modify theuserDataDirectory
property (which is the default), theWebEngine
continues without the user data directory. -
USER_DATA_DIRECTORY_IO_ERROR
This event occurs when aWebEngine
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 itsinvalid @link
userDataDirectory
java.io.IOException
), theWebEngine
invokes theWebEngine.onError
event handler, if any, with aUSER_DATA_DIRECTORY_IO_ERROR
event. If the invoked event handler modifies theuserDataDirectory
property, theWebEngine
retries with the new user data directory as soon as the handler returns. If the handler does not modify theuserDataDirectory
property (which is the default), theWebEngine
continues without the user data directory. -
USER_DATA_DIRECTORY_SECURITY_ERROR
This event occurs when aWebEngine
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 itsinvalid @link
userDataDirectory
java.lang.SecurityException
), theWebEngine
invokes theWebEngine.onError
event handler, if any, with aUSER_DATA_DIRECTORY_SECURITY_ERROR
event. If the invoked event handler modifies theuserDataDirectory
property, theWebEngine
retries with the new user data directory as soon as the handler returns. If the handler does not modify theuserDataDirectory
property (which is the default), theWebEngine
continues without the user data directory.
-
-
Constructor Details
-
WebErrorEvent
public WebErrorEvent(Object source, EventType<WebErrorEvent> type, String message, Throwable exception) Creates a newWebErrorEvent
.- Parameters:
source
- the event source which sent the eventtype
- the event typemessage
- the text message associated with the event; may benull
exception
- the exception associated with the event; may benull
-
-
Method Details
-
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
Returns the exception associated with this event.- Returns:
- the exception associated with this event, or
null
if there is no such exception
-